Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BlogsController < ApplicationController
- def show
- @blog = Blog.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- flash[:notice] = "The blog you were looking for could not be found"
- redirect_to root_path
- # or blogs_path
- end
Add Comment
Please, Sign In to add comment