Skip to content

Instantly share code, notes, and snippets.

@colmtuite
Created July 24, 2017 23:16
Show Gist options
  • Save colmtuite/cd61fc619fcf86ec44b2c97b3648e20b to your computer and use it in GitHub Desktop.
Save colmtuite/cd61fc619fcf86ec44b2c97b3648e20b to your computer and use it in GitHub Desktop.
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