Forum: Ruby on Rails Adding routes and link_to

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1f5a4e0a8b163639ad448ac380d8b756?d=identicon&s=25 Sylvain Petit (sobert)
on 2009-01-04 11:20
(Received via mailing list)
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:in `recognize'
    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:in `dispatch_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:in `synchronize'
    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:in `dispatch_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:in `process'


Any ideas ?

Thanks !
9a2a53db8e9b4476038c94a64b32833f?d=identicon&s=25 Ryan Bigg (ryan-bigg)
on 2009-01-04 12:35
(Received via mailing list)
can you show us the code you're using for the link_tos please?
-----
Ryan Bigg
Freelancer
http://frozenplague.net
1f5a4e0a8b163639ad448ac380d8b756?d=identicon&s=25 Sylvain Petit (sobert)
on 2009-01-04 12:39
(Received via mailing list)
Here's the link_to code :

<li><%= link_to 'News', news_path %></li>

<%= link_to 'Login', login_path %>
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-01-04 22:48
> 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
1f5a4e0a8b163639ad448ac380d8b756?d=identicon&s=25 Sylvain Petit (sobert)
on 2009-01-05 01:20
(Received via mailing list)
Oh, thanks, it works !

On 4 jan, 22:48, Fernando Perez <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.