# Broken route path?

**URL:** <https://www.ruby-forum.com/t/broken-route-path/184904>\
**Category:** Rails\
**Created:** [March 10, 2010, 8:19am UTC](https://www.ruby-forum.com/t/broken-route-path/184904 "2010-03-10T08:19:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [March 10, 2010, 8:19am UTC](https://www.ruby-forum.com/t/broken-route-path/184904/1 "2010-03-10T08:19:12Z")

</div>

I’ve added the following to routes.rb

map.resource :login

if I do a rake routes I see

yadav@Energy64X2 $ 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:in`const\_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:in`constantize’  
/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:in`constantize’  
/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:in`recognize’  
/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.

---

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [March 10, 2010, 9:05am UTC](https://www.ruby-forum.com/t/broken-route-path/184904/2 "2010-03-10T09:05:26Z")

</div>

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.
