Guest User

Untitled

a guest
Sep 12th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.37 KB | None | 0 0
  1.  def require_blog_owner                                                                                                                                                            
  2.     blog = Blog.find_by_short_name(params[:id])
  3.     unless blog.blogger.id == current_blogger.id
  4.       flash[:error] = "You can't update that blog"
  5.       redirect_to(root_path)
  6.     end
  7.   end
Add Comment
Please, Sign In to add comment