Reputation: 463
I'm using Google's AMP in a project, and want to redirect to the AMP version of a resource when a user creates a new resource.
I have a model named Guide
. My controller create
action, looks like this - pretty basic:
def create
console
@guide = Guide.new(guide_params)
if @guide.save
redirect_to @guide
else
redirect_to :action => "new", notice: "Something went wrong, sorry!"
end
end
How do I make redirect_to go to the AMP version of that page? e.g. instead of going to /guides/12345
, it goes to /guides/12345.amp
.
Upvotes: 0
Views: 189