Sha256: 0811acffdd1717860e727a4056b1b016a91f2360ae1d5f4e30239841b1dc93a6

Contents?: true

Size: 367 Bytes

Versions: 4

Compression:

Stored size: 367 Bytes

Contents

class SofaBlog::PostsController < ApplicationController
  def index
    @posts = SofaBlog::Post.published.all
  rescue ActiveRecord::RecordNotFound
    render :text => 'Post not found', :status => 404
  end
  
  def show
    @post = SofaBlog::Post.find(params[:id])
  rescue ActiveRecord::RecordNotFound
    render :text => 'Post not found', :status => 404
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sofa_blog-0.1.3 app/controllers/sofa_blog/posts_controller.rb
sofa_blog-0.1.2 app/controllers/sofa_blog/posts_controller.rb
sofa_blog-0.1.1 app/controllers/sofa_blog/posts_controller.rb
sofa_blog-0.1.0 app/controllers/sofa_blog/posts_controller.rb