Re: [Rails] Controller named /2010
Ruby won't let you make a class called 2010Controller, as it is not a
valid class name.
Why are you being told to create a controller of a specific name? Is
it for path reasons? If so, call it something else (./script/generate
controller twenty_ten) and then use a route to set things up from
/2010/ to what you just made.
--Michael
On Wed, Dec 30, 2009 at 11:32, theduz <duzenbury@gmail.com> wrote:
> Hi,
>
> I've been asked to create a controller called 2010 on rails 2.3.2 but
> script/generate controller 2010 fails with
>
> wrong constant name 2010Helper
>
> I tried creating everything manually, but still receive a 'wrong
> constant name' error.
>
> NameError in 2010Controller#index
>
> wrong constant name 2010Controller
>
> So, is there any way to fix this up to get it to work?
>
> Thank you.
>
>
> Regards,
> Rich
>
>
> Here is a partial stack trace, btw.
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/
> active_support/inflector.rb:285:in `const_defined?'
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/
> active_support/inflector.rb:285:in `constantize'
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/
> active_support/inflector.rb:284:in `each'
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/
> active_support/inflector.rb:284:in `constantize'
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/
> active_support/core_ext/string/inflections.rb:143:in `constantize'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/
> action_controller/routing/route_set.rb:386:in `recognize'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/
> action_controller/dispatcher.rb:148:in `handle_request'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/
> action_controller/dispatcher.rb:107:in `dispatch'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/
> action_controller/dispatcher.rb:104:in `synchronize'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/
> action_controller/dispatcher.rb:104:in `dispatch'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/
> action_controller/dispatcher.rb:120:in `dispatch_cgi'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/
> action_controller/dispatcher.rb:35:in `dispatch'
>
> --
>
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
>
--
(Ruby, Rails, Random) blog: http://skandragon.blogspot.com/
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home