# RESTful question

**URL:** <https://www.ruby-forum.com/t/restful-question/93111>\
**Category:** Rails\
**Created:** [April 27, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/restful-question/93111 "2007-04-27T17:56:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshuajnoble](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@joshuajnoble](https://www.ruby-forum.com/u/joshuajnoble)\
**Post date:** [April 27, 2007, 5:56pm UTC](https://www.ruby-forum.com/t/restful-question/93111/1 "2007-04-27T17:56:34Z")

</div>

I have a question about a RESTful basic that I’m a little confused  
about. I have a login method that I want to call for anyone trying to  
use any admin methods.

So my admin\_controller has a filter like so:

before\_filter :admin\_authenticate, :except =\> :login

before I went RESTful everything was fine just using “[http://localhost](http://localhost):  
3000/admins/login” but now I have to use “[http://localhost:3000/admins/](http://localhost:3000/admins/)  
login/1”. I don’t want to need the id in there since we’re not going  
to know the admins id before they log in, but I’m not sure what I need  
to do to get the controller to respond simply to “[http://localhost](http://localhost):  
3000/admins/login”

I’m thinking this is something that I’m just not understanding about  
routing. Can anyone elucidate me?

---

<div class="post-metadata">

**Author:** ![joshuajnoble](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@joshuajnoble](https://www.ruby-forum.com/u/joshuajnoble)\
**Post date:** [April 27, 2007, 7:35pm UTC](https://www.ruby-forum.com/t/restful-question/93111/2 "2007-04-27T19:35:43Z")

</div>

Check out the restful\_authentication plugin. It explains all of this  
for you through the use of the session resource.

Michael
