Class PostsController
In: app/controllers/posts_controller.rb
Parent: ApplicationController

Methods

index   show  

Public Instance methods

[Source]

    # File app/controllers/posts_controller.rb, line 3
 3:   def index
 4:     @title = t('documents.Blog')
 5:     @feed_title = t('documents.feed_title', :name => t('site_name'))
 6:     
 7:     @posts = Post.published.translated.paginate( :page => params[:page], :per_page => 15, :order => 'published_at DESC')
 8:     respond_to do |format|
 9:       format.html
10:       format.rss {render :layout => false}
11:     end
12:   end

[Source]

    # File app/controllers/posts_controller.rb, line 14
14:   def show
15:     begin
16:       @post = Post.published.find(params[:id])
17:     rescue ActiveRecord::RecordNotFound
18:       if can_edit?("posts")
19:         @post = Post.find(params[:id])
20:       else
21:         raise ActiveRecord::RecordNotFound
22:       end
23:     end
24:     
25:     @parent = @post
26:     @comments = @post.comments.approved.paginate :page => params[:page], :per_page => 50
27:   end

[Validate]