# Login and RESTful problem

**URL:** <https://www.ruby-forum.com/t/login-and-restful-problem/135444>\
**Category:** Rails\
**Created:** [April 22, 2008, 9:14am UTC](https://www.ruby-forum.com/t/login-and-restful-problem/135444 "2008-04-22T09:14:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 22, 2008, 9:14am UTC](https://www.ruby-forum.com/t/login-and-restful-problem/135444/1 "2008-04-22T09:14:05Z")

</div>

I’ve used this [http://www.aidanf.net/rails\_user\_authentication\_tutorial](http://www.aidanf.net/rails_user_authentication_tutorial)  
for Authenticate before. Now I’m trying to learn RESTful. How do I make  
it work? When trying to go to the login I get a server error, as it  
tries to load the show action. How can I get past this when going to  
/groups/login?

I partially solved it by map.resources :groups, :collection =\> {:login  
=\> :any}, but then post doesn’t work.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 22, 2008, 10:32am UTC](https://www.ruby-forum.com/t/login-and-restful-problem/135444/2 "2008-04-22T10:32:26Z")

</div>

Did you add to routes.rb:

map.signup ‘/signup’, :controller =\> ‘users’, :action =\> ‘new’  
map.login ‘/login’, :controller =\> ‘sessions’, :action =\> ‘new’  
map.logout ‘/logout’, :controller =\> ‘sessions’, :action =\> ‘destroy’

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [April 22, 2008, 10:38am UTC](https://www.ruby-forum.com/t/login-and-restful-problem/135444/3 "2008-04-22T10:38:32Z")

</div>

Fernando P. wrote:

> Did you add to routes.rb:
> 
> map.signup ‘/signup’, :controller =\> ‘users’, :action =\> ‘new’  
> map.login ‘/login’, :controller =\> ‘sessions’, :action =\> ‘new’  
> map.logout ‘/logout’, :controller =\> ‘sessions’, :action =\> ‘destroy’

Perfect. That solved it. 🙂
