Skip to content

Instantly share code, notes, and snippets.

@123ish
Forked from kevinhq/samples_controller.rb
Created July 9, 2020 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 123ish/677997c9bd3063eb4ad8b3aba0677021 to your computer and use it in GitHub Desktop.
Save 123ish/677997c9bd3063eb4ad8b3aba0677021 to your computer and use it in GitHub Desktop.
Create AMP in Rails powered website - samples_controller.rb
# app/controllers/samples_controller.rb
Class SamplesController
# other existing methods
def show
# your existing codes
respond_to do |format|
format.html
format.amp { render 'amp/samples/show.amp', layout: 'amp/layouts/application' }
end
end
# other existing methods
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment