Created
July 24, 2017 23:16
-
-
Save colmtuite/cd61fc619fcf86ec44b2c97b3648e20b 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 show | |
@website = Website.find(params[:id]) | |
@page = Page.new | |
unless @website.user_id == current_user.id | |
flash[:error] = "Oi, stop snooping around!" | |
redirect_to current_user | |
end | |
unless params[:id] == @website.to_param | |
redirect_to @website, status: 301 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment