This project is archived and is in readonly mode.
Resources is not passing all options to yield
-
Daniel Libanori
- Tag set to rails3 routes
At actionack/lib/action_dispatch/routing/mapper.rb, resources pass resource.options to scope...
def resources(*resources, &block) ... with_scope_level(:member) do scope(':id') do scope(resource.options) do get :show if resource.actions.include?(:show) put :update if resource.actions.include?(:update) delete :destroy if resource.actions.include?(:destroy) get :edit, :as => resource.singular if resource.actions.include?(:edit) end end ... endbut member is not passing.
def member unless @scope[:scope_level] == :resources raise ArgumentError, "can't use member outside resources scope" end with_scope_level(:member) do scope(':id', :name_prefix => parent_resource.member_name, :as => "") do yield end end endOddly, some options like 'as' works nice.
-
Daniel Libanori
- Tag changed from rails3 routes to rails3, routes
-
Daniel Libanori
This patch can help to solve bug #3765 Missing shallow routes in new router DSL too. It uses a better way to create default CRUD actions.
-
Daniel Libanori
Here is the patch.
-
Andrew White
- State changed from new to resolved
- Assigned user changed from Ryan Bigg to Andrew White
- Importance changed from to Low
This appears to be resolved by the patch applied from #3765 Missing shallow routes in new router DSL. Please comment here if you think it doesn't.
