implemented forum post controller

This commit is contained in:
albert
2011-01-13 18:16:39 -05:00
parent 523cc9fe02
commit 541163685d
13 changed files with 121 additions and 42 deletions

View File

@@ -15,7 +15,8 @@ class ForumPostsController < ApplicationController
end
def index
@forum_posts = ForumPost.search(params[:search])
@search = ForumPost.search(params[:search])
@forum_posts = @search.paginate(:page => params[:page], :order => "id DESC")
respond_with(@forum_posts)
end
@@ -25,7 +26,7 @@ class ForumPostsController < ApplicationController
end
def create
@forum_post = ForumPost.new(params[:forum_post])
@forum_post = ForumPost.create(params[:forum_post])
respond_with(@forum_post)
end