Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_category
- # current_user dealt with in before filter
- @category = current_user.categories.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- flash[:error] = "The category you're looking for could not be found."
- redirect_to root_path
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement