#3 accepted
humancopy

: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

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.

New ticket Create new ticket

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.

People watching this ticket

Pages