initializers

Have a bit of a conundrum that I need to solve

I would like to put this into environment.rb...

config.action_mailer.default_url_options = { :host => Setting[:website_url] }

but it obviously can't read from the database before it is initialized and the configuration for action_mailer 'options' apparently goes into environment.rb

Is there someplace I can put this so that it loads after Rails is started?

Craig

Have a bit of a conundrum that I need to solve

I would like to put this into environment.rb...

config.action_mailer.default_url_options = { :host => Setting[:website_url] }

but it obviously can't read from the database before it is initialized and the configuration for action_mailer 'options' apparently goes into environment.rb

Is there someplace I can put this so that it loads after Rails is started?

Um, perhaps in the directory mentioned in your subject line? Files in config/initializers will be loaded after the Rails stack has been initialized.

--Matt Jones

> Have a bit of a conundrum that I need to solve > > I would like to put this into environment.rb... > > config.action_mailer.default_url_options = { :host => > Setting[:website_url] } > > but it obviously can't read from the database before it is initialized > and the configuration for action_mailer 'options' apparently goes into > environment.rb > > Is there someplace I can put this so that it loads after Rails is > started?

Um, perhaps in the directory mentioned in your subject line? Files in config/initializers will be loaded after the Rails stack has been initialized.