moved some donmai-specific stuff out of default config

This commit is contained in:
albert
2010-11-19 13:44:11 -05:00
parent 190beedb7a
commit a156cc8c62
11 changed files with 89 additions and 43 deletions

View File

@@ -1,22 +1,42 @@
class ForumTopicsController < ApplicationController
def new
@forum_topic = ForumTopic.new
end
def edit
@forum_topic = ForumTopic.find(params[:id])
end
def index
@search = ForumTopic.search(params[:search])
@forum_topics = @search.paginate(:page => params[:page], :order => "updated_at DESC")
end
def show
@forum_topic = ForumTopic.find(params[:id])
end
def create
@forum_topic = ForumTopic.new(params[:forum_topic])
if @forum_topic.save
redirect_to forum_topic_path(@forum_topic)
else
render :action => "new"
end
end
def update
@forum_topic = ForumTopic.find(params[:id])
if @forum_topic.update_attributes(params[:forum_topic])
redirect_to forum_topic_path(@forum_topic)
else
render :action => "edit"
end
end
def destroy
@forum_topic = ForumTopic.find(params[:id])
@forum_topic.destroy
redirect_to forum_topics_path
end
end