You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a constraint to a routes.rb scope breaks the path template helper methods:
scope ':api_version', api_version: /v1|v2/ do
... later
api_story_path_template(api_version: represented.version, id: '{id}')
... throws
ActionController::UrlGenerationError (No route matches {:action=>"show", :api_version=>"_API_VERSION_REPLACE_", :controller=>"api/stories", :id=>"_ID_REPLACE_"} missing required keys: [:api_version]):
app/representers/api/api_representer.rb:17:in `block in <class:ApiRepresenter>'
app/controllers/api/api_responder.rb:14:in `api_behavior'
app/controllers/api/base_controller.rb:35:in `entrypoint'
Appears to be due to how uri_methods.rb replaces the "v1" version string with the placeholder "_API_VERSION_REPLACE_" ... which doesn't match the regex.
The text was updated successfully, but these errors were encountered:
Adding a constraint to a routes.rb scope breaks the path template helper methods:
Appears to be due to how uri_methods.rb replaces the
"v1"
version string with the placeholder"_API_VERSION_REPLACE_"
... which doesn't match the regex.The text was updated successfully, but these errors were encountered: