socialforge/app/controllers/discuss_demo_controller.rb

28 lines
538 B
Ruby

class DiscussDemoController < ApplicationController
def index
@discuss_demo_list = DiscussDemo.order("created_at desc").page(params[:page] || 1).per(10)
end
def new
end
def create
discuss_demo = DiscussDemo.new(:title => params[:discuss_demo][:title],:body =>params[:discuss_demo][:body])
discuss_demo.save!
redirect_to :controller=>'discuss_demo',:action => 'show',:id => discuss_demo.id
end
def update
end
def delete
end
def show
@discuss_demo = DiscussDemo.find(params[:id])
end
end