-
-
Save andyh/95770e17a8df4059c4d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment