Broken route path?

I’ve added the following to routes.rb

map.resource :login

if I do a rake routes I see

[email protected] $ rake routes
(in /home/yadav/dev/rails/upload)
new_login GET /login/new(.:format)
{:controller=>“logins”, :action=>“new”}
edit_login GET /login/edit(.:format)
{:controller=>“logins”, :action=>“edit”}
login GET /login(.:format)
{:controller=>“logins”, :action=>“show”}
PUT /login(.:format)
{:controller=>“logins”, :action=>“update”}
DELETE /login(.:format)
{:controller=>“logins”, :action=>“destroy”}
POST /login(.:format)
{:controller=>“logins”, :action=>“create”}

However my login form break when I use

<% form_tag login_path do %>

I am forced to use

<% form_tag ‘/login/create’ do %>

otherwise I get the following error

NameError in LoginsController#create
uninitialized constant LoginsController
RAILS_ROOT: /home/yadav/dev/rails/upload
Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in
load_missing_constant' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:inconst_missing’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:inconstantize’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
each' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:inconstantize’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in
constantize' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:inrecognize’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in
`call’


Kind Regards,
Rajinder Y.

Rajinder Y. wrote:

edit_login GET /login/edit(.:format) {:controller=>“logins”,
However my login form break when I use
uninitialized constant LoginsController
I realized my error, I created the login controller as a singular, so
rails got tripped up. It’s working now.

Kind Regards,
Rajinder Y.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs