# How does one get a Rails 3 "app name"

**URL:** <https://www.ruby-forum.com/t/how-does-one-get-a-rails-3-app-name/195220>\
**Category:** Rails\
**Created:** [September 20, 2010, 4:01am UTC](https://www.ruby-forum.com/t/how-does-one-get-a-rails-3-app-name/195220 "2010-09-20T04:01:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 20, 2010, 4:01am UTC](https://www.ruby-forum.com/t/how-does-one-get-a-rails-3-app-name/195220/1 "2010-09-20T04:01:53Z")

</div>

From within a Rails 3 Gem I’m working on, I need to get the app’s  
name. i.e., the value of the module that wraps the application class  
in application.rb. Is there some global-syle variable that contains  
that?

#application.rb  
module MyAppName  
class Application \< Rails::Application  
end  
end

Thanks.  
Elliott G

---

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 20, 2010, 5:29am UTC](https://www.ruby-forum.com/t/how-does-one-get-a-rails-3-app-name/195220/2 "2010-09-20T05:29:04Z")

</div>

Rails.application.class.parent

Daniel GaytÃ¡n

2010/9/19 elliottg [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![elliottg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b77776/32.png) [@elliottg](https://www.ruby-forum.com/u/elliottg)\
**Post date:** [September 20, 2010, 6:13am UTC](https://www.ruby-forum.com/t/how-does-one-get-a-rails-3-app-name/195220/3 "2010-09-20T06:13:33Z")

</div>

Thanks Daniel!

I need to sift through Rails.application in general it seems.

Elliott G

On Sep 19, 11:28 pm, Daniel Gaytán [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
