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,19 +1,37 @@
class ForumPostsController < ApplicationController
def new
@forum_post = ForumPost.new(:topic_id => params[:topic_id])
end
def edit
@forum_post = ForumPost.find(params[:id])
end
def show
@forum_post = ForumPost.find(params[:id])
end
def create
@forum_post = ForumPost.new(params[:forum_post])
if @forum_post.save
redirect_to forum_post_path(@forum_post)
else
render :action => "new"
end
end
def update
@forum_post = ForumPost.find(params[:id])
if @forum_post.update_attributes(params[:forum_post])
redirect_to forum_post_path(@forum_post)
else
render :action => "edit"
end
end
def destroy
@forum_post = ForumPost.find(params[:id])
@forum_post.destroy
redirect_to forum_topic_path(@forum_post.topic_id)
end
end