forum previews working
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class DtextController < ApplicationController
|
||||
def preview
|
||||
render :inline => "<h1>Preview</h1><%= format_text(params[:body]) %>"
|
||||
render :inline => "<h1 class=\"preview-header\">Preview</h1><%= format_text(params[:body]) %>"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,6 +19,10 @@ class ForumPostsController < ApplicationController
|
||||
@forum_posts = @search.paginate(:page => params[:page], :order => "id DESC")
|
||||
respond_with(@forum_posts)
|
||||
end
|
||||
|
||||
def search
|
||||
@search = ForumPost.search(params[:search])
|
||||
end
|
||||
|
||||
def show
|
||||
@forum_post = ForumPost.find(params[:id])
|
||||
|
||||
@@ -18,7 +18,7 @@ class ForumTopicsController < ApplicationController
|
||||
|
||||
def index
|
||||
@search = ForumTopic.search(params[:search])
|
||||
@forum_topics = @search.paginate(:page => params[:page], :order => "updated_at DESC")
|
||||
@forum_topics = @search.paginate(:page => params[:page], :order => "is_sticky DESC, updated_at DESC")
|
||||
respond_with(@forum_topics)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user