Class: SofaBlog::PostsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SofaBlog::PostsController
- Defined in:
- app/controllers/sofa_blog/posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
2 3 4 5 6 |
# File 'app/controllers/sofa_blog/posts_controller.rb', line 2 def index @posts = SofaBlog::Post.published.all rescue ActiveRecord::RecordNotFound render :text => 'Post not found', :status => 404 end |
#show ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/sofa_blog/posts_controller.rb', line 8 def show @post = SofaBlog::Post.find(params[:id]) rescue ActiveRecord::RecordNotFound render :text => 'Post not found', :status => 404 end |