This project is archived and is in readonly mode.
Routing map.namespace function definition bug
-
Pawel Barcik
(better formated copy of the post)
file actionpack-2.3.4/lib/action_controller/routing/route_set.rb
does line 49 in this file not suppose to be47 def namespace(name, options = {}, &block) 48 if options[:namespace] 49 with_options({:path_prefix => "#{options.delete(:path_prefix)}/#{name}", :name_prefix => "#{options.delete(:name_prefix)}#{name}", :namespace => "#{options.delete(:namespace )}#{name}/" }.merge(options), &block) 50 else 51 with_options({:path_prefix => name, :name_prefix => "#{name}", :namespace => "#{name}/" }.merge(options), &block) 52 end 53 end
with #{name} deleted ?49 with_options({:path_prefix => "#{options.delete(:path_prefix)}/#{name}", :name_prefix => "#{options.delete(:name_prefix)}#{name}_", :namespace => "#{options.delete(:namespace )}/" }.merge(options), &block)because this route is causing problems when used with this route:
map.namespace :panel, :namespace => 'admin_panel' do |admin_panel|
admin_panel.root :controller => 'panel' admin_panel.connect ':controller/:action/:id'
error:
enduninitialized constant AdminPanelpanel /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in `load_missing_constant' /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies' /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:92:in `const_missing' /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/inflector.rb:372:in `const_get' /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/inflector.rb:372:in `block in constantize' /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/inflector.rb:371:in `each' /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/inflector.rb:371:in `constantize' /usr/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' /usr/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:443:in `recognize' /usr/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:436:in `call'the route used:
mydomain.com/panel/
-
Rohit Arondekar
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.