这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@anitagraham
Copy link
Contributor

This PR changes the order of frontend routes generated when adding a second or subsequent route to an extension. See gitter discussion with jussihirvi on May 10.

The current routes generated by

generate refinery:engine place name:string
generate refinery:engine person  name:string --extension places --namespace places

are (with intervening lines removed)

  # Frontend routes
  namespace :places do
    resources :places, :path => '', :only => [:index, :show]
  end
  # Frontend routes
  namespace :places do
    resources :people, :only => [:index, :show]
  end

Trying to access /places/people results in "Couldn't find Refinery::Places::Place with 'id'=people", as routes are matched in the order defined.

With the changes the routes (with even more lines removed) become:

  namespace :places do
    resources :people, :only => [:index, :show]
    resources :places, :path => '', :only => [:index, :show]
  end

@parndt parndt merged commit 0473938 into refinery:master May 25, 2018
@bricesanchez bricesanchez added this to the 5.0 milestone Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants