Adding routes and link_to


#1

Hello.

I’ve added some routes :

map.news ‘news’, :controller => :News, :action =>:index

map.login ‘login’, :controller => :Login , :action =>:index

When I go to /news or /login before adding the routes, it works well.

When I add the routes and clik on the link that goes to /news or /
login, I got a 500 internal error with this :

/!\ FAILSAFE /!\ Sun Jan 04 11:18:54 +0100 2009
Status: 500 Internal Server Error
undefined method camelize' for :News:Symbol c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/routing/route_set.rb:388:inrecognize’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:182:in handle_request' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:110:indispatch_unlocked’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:123:in dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:122:insynchronize’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:122:in dispatch' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:132:indispatch_cgi’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:39:in dispatch' c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../ lib/mongrel/rails.rb:76:inprocess’

Any ideas ?

Thanks !


#2

can you show us the code you’re using for the link_tos please?

Ryan B.
Freelancer
http://frozenplague.net


#3

I’ve added some routes :

map.news ‘news’, :controller => :News, :action =>:index

map.login ‘login’, :controller => :Login , :action =>:index

This is wrong, it should be:

map.news ‘news’, :controller => ‘news’, :action => ‘index’

Best regards,


Video tutorial training with screencasts at http://www.digiprof.fr


#4

Here’s the link_to code :

  • <%= link_to 'News', news_path %>
  • <%= link_to ‘Login’, login_path %>


    #5

    Oh, thanks, it works !

    On 4 jan, 22:48, Fernando P. removed_email_address@domain.invalid