Rails mountable engine: how should apps set configuration variables?

Viewed 5789

I have a mountable engine called Blog that apps can use.

What's the best way to allow apps that use the engine to set a configuration variable like site_name (so that the engine can display it in the design)?

Update:

I've seen some gems create a 'config/initializers/gem_name.rb' file. Is there any specification on how to:

  1. Create a file like that on the engine's side
  2. Copy it into the app's side
  3. How to access those set variables on the engine's side?

I tried creating Blog.site_name = "My Site" in the app's config/initializers/blog.rb file but get an Undefined method error.

3 Answers
Related