:as makes resources_controller go crazy :)
Reported by humancopy | April 23rd, 2009 @ 05:56 AM
hey
when using :as in the routes, things break in resources_controller...
i have a route like this defined:
map.resources :chairs, :as => 'education' do |chairs|
chairs.resources :publications, :collection => {:order => :put}
chairs.resources :staffs, :as => 'staff'
end
this causes 2 bugs...
the first, publications doesn't get recognized: ....can't match the route to the resource specification...
second bug, causes the order action to fail saying: NameError (uninitialized constant Element):
this is the last part of the log:
vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant'
vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
vendor/rails/activesupport/lib/active_support/inflector.rb:361:in `constantize'
vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `each'
vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `constantize'
vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
vendor/plugins/resources_controller/lib/ardes/resources_controller/specification.rb:51:in `initialize'
vendor/plugins/resources_controller/lib/ardes/resources_controller/specification.rb:21:in `new'
vendor/plugins/resources_controller/lib/ardes/resources_controller/specification.rb:21:in `new'
vendor/plugins/resources_controller/lib/ardes/resources_controller.rb:763:in `load_wildcard'
vendor/plugins/resources_controller/lib/ardes/resources_controller.rb:784:in `load_wildcards_from'
vendor/plugins/resources_controller/lib/ardes/resources_controller.rb:784:in `times'
vendor/plugins/resources_controller/lib/ardes/resources_controller.rb:784:in `load_wildcards_from'
vendor/plugins/resources_controller/lib/ardes/resources_controller.rb:745:in `load_enclosing_resources'
let me know if it isn't clear enough :)
Comments and changes to this ticket
-
Nilbus July 18th, 2009 @ 11:26 PM
I also have this issue. This prevents me from using the plugin at all, since my main model uses :as.
-
Ian White July 21st, 2009 @ 12:06 PM
Thanks for the ticket.
I should be able work on this in the coming week
-
Ian White July 21st, 2009 @ 01:21 PM
- State changed from new to accepted
Just tried :as out on a rails 2.2 project and everything worked fine with a nested resource.
I'll get a test case up and run it against all the the 2.x versions, but could you tell me what version of rails you;re using?
-
Ian White September 29th, 2009 @ 03:12 PM
What happens if you do this (in the latest version of RC)
resources_controller_for :chair, :segment => 'education'
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
resources_controller is a rails plugin that eases the pain of RESTful controllers.