Skip to content

@elricstorm /old_routes.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# OLD Routes.rb file - showing changes
#Rails.application.routes.draw do |map|
Rails.application.routes.draw do
mount_at = Cheese::Engine.config.mount_at
match mount_at => 'cheese/widgets#index'
# map.resources :widgets, :only => [ :index, :show ],
resources :widgets, :only => [ :index, :show ],
:controller => "cheese/widgets",
#:path_prefix => mount_at, (deprecated)
#:name_prefix => "cheese_" (deprecated)
:as => "cheese_"
end
# corrected routes file
Rails.application.routes.draw do
mount_at = Cheese::Engine.config.mount_at
match mount_at => 'cheese/widgets#index'
scope mount_at do
resources :widgets, :only => [ :index, :show ],
:controller => "cheese/widgets",
:as => "cheese_widgets"
end
end
# this produces:
# cheese /cheese(.:format)
# cheese_widgets GET /cheese/widgets(.:format)
# cheese_widget GET /cheese/widgets/:id(.:format)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.