Is the application name available as a variable?

When I create a rails application,

Prefixes:

rails new foo

Is the string "foo" available to my code?

puts "Your app name is " + app_name_bar
+4
source share
1 answer

Rails.application.class will give you the full name of the application (e.g. YourAppName :: Application).

From there you can get the module name with Rails.application.class.parent.

+5
source

All Articles