Created
December 29, 2010 16:00
-
-
Save elricstorm/758668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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