Class: PostsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PostsController
- Defined in:
- app/controllers/posts_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#show ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/posts_controller.rb', line 4 def show posts = Rails.env.test? || can?(:manage, Post.first) ? @blog.posts : @blog.posts.published @post = posts.by_slug(params[:post_slug]).first render_404 if @post.nil? end |