On Oct 26, 2005, at 4:11 PM, Jerrett Taylor wrote:
> I''m trying to figure something out with the Initializer stuff in
.14,
> and I can''t tell if I''m missing something or if something
was
> overlooked..
>
> What I want to do is something like this:
> config.action_mailer.server_settings[:address] =
''192.168.40.5''
>
> The following works, but redefines the entire hash (server_settings),
> what I
> want to do is to modify one of the elements, not redefine the entire
> thing.
> config.action_mailer.server_settings = { :address =>
''192.168.40.5'' }
>
>
> Prior to .14, I was setting it with:
> ActionMailer::Base.server_settings[:address] =
''192.168.40.5''
>
>
>
> Anyone have any insight?
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
Here is a little snippet form irb:
irb(main):001:0> h = {:a => ''blah'', :b =>
''foo'' }
=> {:a=>"blah", :b=>"foo"}
irb(main):002:0> h.merge!({:a => ''bar''})
=> {:a=>"bar", :b=>"foo"}
irb(main):003:0>
So you could do it like this:
config.action_mailer.server_settings.merge!({ :address =>
''192.168.40.5'' })
HTH-
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org