# Possible to have a model named 'Application'?

**URL:** <https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004>\
**Category:** Rails\
**Created:** [May 29, 2008, 9:30pm UTC](https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004 "2008-05-29T21:30:54Z")\
**Posts on this page:** 6\
**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:** [May 29, 2008, 9:30pm UTC](https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004/1 "2008-05-29T21:30:54Z")

</div>

Just wondering if it’s possible to have a model named Application in  
rails 2.0. It seems to be blowing up when I try, and I’m wondering if  
there’s a workaround. Thanks!

---

<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:** [May 29, 2008, 9:38pm UTC](https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004/2 "2008-05-29T21:38:36Z")

</div>

On May 29, 7:42 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Just wondering if it’s possible to have a model named Application in  
> rails 2.0. It seems to be blowing up when I try, and I’m wondering if  
> there’s a workaround. Thanks!

Probably asking for trouble seeing as application\_controller lives in  
application.rb (for (from what I gather) largely historical reasons.

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:** [May 29, 2008, 11:05pm UTC](https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004/3 "2008-05-29T23:05:14Z")

</div>

A model named Application is going to map, by default, to a controller  
named  
application\_controller. And that name’s already taken. You can work  
around  
it if you really want to, but you’ll find it a lot easier to just name  
your  
model something else. MyApplication, InHouseApplication, etc.

HTH,  
Bill

---

<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:** [May 30, 2008, 12:04am UTC](https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004/4 "2008-05-30T00:04:33Z")

</div>

I’d pass on using Application as a model name. I’d become familiar with  
the conventions of Rails and make sure that I didn’t name any models  
Application or Layout for starters

---

<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:** [May 30, 2008, 1:43am UTC](https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004/5 "2008-05-30T01:43:36Z")

</div>

Might work, but it’s gonna be trouble-prone. Rails is convention-based.  
The conventions are ‘baked-in’. Unscramble an egg 😉

---

<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:** [May 30, 2008, 12:01am UTC](https://www.ruby-forum.com/t/possible-to-have-a-model-named-application/139004/6 "2008-05-30T00:01:02Z")

</div>

Can’t he use a named route without any problems?
