forum previews working

This commit is contained in:
albert
2011-03-12 16:09:11 -05:00
parent 21cc1cbafa
commit bd520f61f7
29 changed files with 1516 additions and 81 deletions

View File

@@ -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

View File

@@ -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])

View File

@@ -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