blob: f31287b44644f1cfd93a5282d5371a52c6a51ae2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
class BlogsController < ApplicationController
def show
@blog = Blog.find_by_slug(params[:slug])
raise ActiveRecord::RecordNotFound unless @blog
raise ActiveRecord::RecordNotFound unless @blog.published or user_signed_in?
end
end
|