# Question on restful\_authentication

**URL:** <https://www.ruby-forum.com/t/question-on-restful-authentication/135245>\
**Category:** Rails\
**Created:** [April 19, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/question-on-restful-authentication/135245 "2008-04-19T18:53:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c0e974/32.png) [@ldt](https://www.ruby-forum.com/u/ldt)\
**Post date:** [April 19, 2008, 6:53pm UTC](https://www.ruby-forum.com/t/question-on-restful-authentication/135245/1 "2008-04-19T18:53:34Z")

</div>

I attempted to run the following command using the  
restful\_authentication plugin and was wondering if anyone could help  
shed some light on this. Here’s my problem - ran:

script/generate authenticated person session

And this generated a number of pluralized files that I thought should  
be singular:

/controllers/people\_controller.rb  
/views/people/

And in routes.rb, I get:

map.resources :peoples

This is the only place where :peoples was found in the project, so I’m  
guessing this is a pluralization issue. If I run the script against  
“user” instead of “people” there is no issue, but I’d really like to  
use “people” as the name. Any suggestions on how I as a Rails novice  
should approach this? Should I clean it up manually, or is there a  
better way to run the generate script?

Thank you for any advice!  
Joe

---

<div class="post-metadata">

**Author:** ![ldt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c0e974/32.png) [@ldt](https://www.ruby-forum.com/u/ldt)\
**Post date:** [April 19, 2008, 8:42pm UTC](https://www.ruby-forum.com/t/question-on-restful-authentication/135245/2 "2008-04-19T20:42:00Z")

</div>

Joe L. wrote:

> I attempted to run the following command using the  
> restful\_authentication plugin and was wondering if anyone could help  
> shed some light on this. Here’s my problem - ran:
> 
> script/generate authenticated person session
> 
> And this generated a number of pluralized files that I thought should  
> be singular:
> 
> /controllers/people\_controller.rb  
> /views/people/
> 
> And in routes.rb, I get:
> 
> map.resources :peoples
> 
> This is the only place where :peoples was found in the project, so I’m  
> guessing this is a pluralization issue. If I run the script against  
> “user” instead of “people” there is no issue, but I’d really like to  
> use “people” as the name. Any suggestions on how I as a Rails novice  
> should approach this? Should I clean it up manually, or is there a  
> better way to run the generate script?
> 
> Thank you for any advice!  
> Joe

The filenames are correct, they are supposed to be plural.

Te route is a bit curous, its like double plural. You should just be  
able to change it to:

map.resources :people

And I believe everything should just work for you with no other changes.

---

<div class="post-metadata">

**Author:** ![ldt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c0e974/32.png) [@ldt](https://www.ruby-forum.com/u/ldt)\
**Post date:** [April 20, 2008, 12:05am UTC](https://www.ruby-forum.com/t/question-on-restful-authentication/135245/3 "2008-04-20T00:05:24Z")

</div>

On Apr 19, 11:42 am, Alex W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> The filenames are correct, they are supposed to be plural.
> 
> Te route is a bit curous, its like double plural. You should just be  
> able to change it to:
> 
> map.resources :people
> 
> And I believe everything should just work for you with no other changes.

That helped, mostly. Thanks!

Creating a user worked fine. Logout worked fine. However, logging back  
in yielded this problem:

NameError in SessionsController#create  
uninitialized constant SessionsController

The only change I made to the session\_controller.rb file was to move  
the “include AuthenticatedSystem” code to the application controller.  
Any suggestions out there?

Thanks much,  
Joe

---

<div class="post-metadata">

**Author:** ![ldt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c0e974/32.png) [@ldt](https://www.ruby-forum.com/u/ldt)\
**Post date:** [April 20, 2008, 1:56am UTC](https://www.ruby-forum.com/t/question-on-restful-authentication/135245/4 "2008-04-20T01:56:38Z")

</div>

Just reporting that I seem to have found the error.

Running script/generate authenticated user sessions works

Sessions must be plural, or else everything will work except the login  
function.

Thanks,  
Joe
