| Module | Apipie::DSL::Controller |
| In: |
lib/apipie/dsl_definition.rb
|
defines the substitutions to be made in the API paths deifned in concerns included. For example:
There is this method defined in concern:
api GET ':controller_path/:id'
def show
# ...
end
If you include the concern into some controller, you can specify the value for :controller_path like this:
apipie_concern_subst(:controller_path => '/users')
include ::Concerns::SampleController
The resulting path will be ’/users/:id’.
It has to be specified before the concern is included.
If not specified, the default predefined substitions are
{:conroller_path => controller.controller_path,
:resource_id => `resource_id_from_apipie` }