Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. def set_category
  2. # current_user dealt with in before filter
  3. @category = current_user.categories.find(params[:id])
  4. rescue ActiveRecord::RecordNotFound
  5. flash[:error] = "The category you're looking for could not be found."
  6. redirect_to root_path
  7. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement