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