Class: ActionDispatch::Routing::Mapper
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/rails/routes.rb
Instance Method Summary collapse
- #crud(*options, &block) ⇒ Object
- #mount_openapi_documentation ⇒ Object
- #mount_openapi_specification(options = {}) ⇒ Object
Instance Method Details
#crud(*options, &block) ⇒ Object
4 5 6 7 |
# File 'lib/rails/routes.rb', line 4 def crud(*, &block) << { except: %w(new edit), defaults: { format: :json } } resources(*, &block) end |
#mount_openapi_documentation ⇒ Object
9 10 11 |
# File 'lib/rails/routes.rb', line 9 def mount_openapi_documentation get :openapi, to: 'openapi#index' end |
#mount_openapi_specification(options = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/rails/routes.rb', line 13 def mount_openapi_specification(={}) name = [:name] || :default get :spec, to: '/openapi#spec', defaults: { format: :json, name: name } end |