# Model command?

**URL:** <https://www.ruby-forum.com/t/model-command/124457>\
**Category:** Rails\
**Created:** [December 28, 2007, 9:41pm UTC](https://www.ruby-forum.com/t/model-command/124457 "2007-12-28T21:41:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 28, 2007, 9:41pm UTC](https://www.ruby-forum.com/t/model-command/124457/1 "2007-12-28T21:41:38Z")

</div>

I’m using the login\_generator and with this new version of Rails, I  
can’t even get my app to work. Everything gives a 500 error. In the  
console, it says this error:

undefined method `model’ for ApplicationController:Class

In the login\_generator plugin, you’re supposed to put this command in  
the application controller:

model :user

When I took it out, it complained about something else…something to  
do with secrets. So how can I fix this? ☹

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 28, 2007, 10:41pm UTC](https://www.ruby-forum.com/t/model-command/124457/2 "2007-12-28T22:41:26Z")

</div>

On 28 Dec 2007, at 20:40, Mike C wrote:

> model :user

model is dead. don’t use it.

> When I took it out, it complained about something else…something to  
> do with secrets. So how can I fix this? ☹

That’s something else. The default session store is the cookie store  
in rails 2.0, which requires you to define a secret in your  
environment.rb.

i.e.  
config.action\_controller.session = {  
:session\_key =\> ‘\_empty\_app\_session’,  
:secret =\> ‘your secret here’  
}

If you generate a new app rails will create a nice long safe secret  
for you. You can run  
rake secret  
to get rails to generate you a nice secret.

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 28, 2007, 10:58pm UTC](https://www.ruby-forum.com/t/model-command/124457/3 "2007-12-28T22:58:27Z")

</div>

Thanks a bunch! Solved my problem. 😃

On Dec 28, 1:40 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
