Todd Nine
2007-Sep-30 08:11 UTC
Creating custom environment specific settings in development.rb available. How do I access them?
Hi all, I''m just learning RoR, so if this is obvious, I apologize. I''m coming from a J2EE development background, and I can''t seem to find the answer I need from Google. I''m using the "acts_as_authenticated" plugin to create a simple user registration system for my site. Everything works fine, but now I want to customize the confirmation URL, and the "from" email address on my confirmation email. I''d like to provide environment specific settings in my environment files. I''d like to add something like the following into development.rb, then into my other environments so configuration and deployment is a breeze. [code] config.user_notifier.from="foo-+RB1Aph5k6s@public.gmane.org" config.user_notifier.siteurl="http://www.mysite.com" [/code] I would then like to access it in the class UserNotifier, which extends ActionMailer::Base. I can''t find any examples on this anywhere, so any hints would be greatly appreciated. Thanks in advance for helping a noob. Todd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
andrewbruce
2007-Sep-30 08:18 UTC
Re: Creating custom environment specific settings in development.rb available. How do I access them?
A simple way is to use constants: CONFIRMATION_URL = ''http://www.bingbangbong.com'' EMAIL_FROM = ''bing-jctc/u2dXk9+ZFDLfuW8jg@public.gmane.org'' You can access them from anywhere if they''re defined in an environment config file. On Sep 30, 9:11 am, Todd Nine <todd.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > I''m just learning RoR, so if this is obvious, I apologize. I''m > coming from a J2EE development background, and I can''t seem to find > the answer I need from Google. I''m using the "acts_as_authenticated" > plugin to create a simple user registration system for my site. > Everything works fine, but now I want to customize the confirmation > URL, and the "from" email address on my confirmation email. I''d like > to provide environment specific settings in my environment files. I''d > like to add something like the following into development.rb, then > into my other environments so configuration and deployment is a > breeze. > > [code] > config.user_notifier.from="f...-+RB1Aph5k6s@public.gmane.org" > config.user_notifier.siteurl="http://www.mysite.com" > [/code] > > I would then like to access it in the class UserNotifier, which > extends ActionMailer::Base. I can''t find any examples on this > anywhere, so any hints would be greatly appreciated. Thanks in > advance for helping a noob. > > Todd--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---