After digging through the rails code to figure out why my asset_host wasn''t getting applied to emails, I realized that it''s because the config object in the context of a mailer is config.action_mailer and not config.action_controller. This means you need to set asset host separately for emails, as config.action_mailer.asset_host. Should this be considered a bug? Is it really logical to have them separated like that, or would it make more sense to have a simple config.asset_host ? If it''s not a bug, it needs to be at least documented, as there''s no mention of this anywhere within action mailer or in asset tag helper -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
On Aug 4, 11:47 pm, mateo <mateo.mur...@gmail.com> wrote:> After digging through the rails code to figure out why my asset_host > wasn''t getting applied to emails, I realized that it''s because the > config object in the context of a mailer is config.action_mailer and > not config.action_controller. This means you need to set asset host > separately for emails, as config.action_mailer.asset_host. > > Should this be considered a bug? Is it really logical to have them > separated like that, or would it make more sense to have a simple > config.asset_host ? If it''s not a bug, it needs to be at least > documented, as there''s no mention of this anywhere within action > mailer or in asset tag helperI think that, if I have followed the discussions aright, the idea is that action_mailer (and perhaps action_resource and active_record) are being decoupled from action_controller as much as possible. That said, it seems to me a sensible compromise is that: 1. If config.action_controller.whatever is not nil 2. and config.action_mailer.whatever is nil 3. then config.action_mailer.whatever should use config.action_controller.whatever as a default This approach could be extended to all of the action_ and active_ components. WDYT? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
On Thu, Aug 5, 2010 at 3:18 PM, byrnejb <byrnejb@harte-lyne.ca> wrote:> 1. If config.action_controller.whatever is not nil > 2. and config.action_mailer.whatever is nil > 3. then config.action_mailer.whatever should use > config.action_controller.whatever as a default > > This approach could be extended to all of the action_ and active_ > components.Totally agree. Robert Pankowecki -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
On Thu, Aug 5, 2010 at 6:18 AM, byrnejb <byrnejb@harte-lyne.ca> wrote:> > > On Aug 4, 11:47 pm, mateo <mateo.mur...@gmail.com> wrote: >> After digging through the rails code to figure out why my asset_host >> wasn''t getting applied to emails, I realized that it''s because the >> config object in the context of a mailer is config.action_mailer and >> not config.action_controller. This means you need to set asset host >> separately for emails, as config.action_mailer.asset_host. >> >> Should this be considered a bug? Is it really logical to have them >> separated like that, or would it make more sense to have a simple >> config.asset_host ? If it''s not a bug, it needs to be at least >> documented, as there''s no mention of this anywhere within action >> mailer or in asset tag helper > > I think that, if I have followed the discussions aright, the idea is > that action_mailer (and perhaps action_resource and active_record) are > being decoupled from action_controller as much as possible. That > said, it seems to me a sensible compromise is that: > > 1. If config.action_controller.whatever is not nil > 2. and config.action_mailer.whatever is nil > 3. then config.action_mailer.whatever should use > config.action_controller.whatever as a default > > This approach could be extended to all of the action_ and active_ > components.For both action_controller and action_mailer, it would make more sense to fallback to whatever is in abstract_controller. I''m not sure there is a config.abstract_controller, though. Jeremy -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
On 5-Aug-10, at 10:09 AM, Jeremy Evans wrote:>>> >> I think that, if I have followed the discussions aright, the idea is >> that action_mailer (and perhaps action_resource and active_record) >> are >> being decoupled from action_controller as much as possible. That >> said, it seems to me a sensible compromise is that: >> >> 1. If config.action_controller.whatever is not nil >> 2. and config.action_mailer.whatever is nil >> 3. then config.action_mailer.whatever should use >> config.action_controller.whatever as a default >> >> This approach could be extended to all of the action_ and active_ >> components. > > For both action_controller and action_mailer, it would make more sense > to fallback to whatever is in abstract_controller. I''m not sure there > is a config.abstract_controller, though. > > JeremyI also think they should both fallback to a common setting, rather than action_mailer falling back to action_controller. config.abstract_controller makes a certain amount of sense, but it''ll probably be a bit confusing to those who don''t fully understand rail''s class structure. How about simply defining config.asset_host ?> > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails- > core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com > . > For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en > . >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
I believe this has been fixed in Rails master. Have you tried? On Aug 5, 11:16 am, Mateo Murphy <mateo.mur...@gmail.com> wrote:> On 5-Aug-10, at 10:09 AM, Jeremy Evans wrote: > > > > > > > > >> I think that, if I have followed the discussions aright, the idea is > >> that action_mailer (and perhaps action_resource and active_record) > >> are > >> being decoupled from action_controller as much as possible. That > >> said, it seems to me a sensible compromise is that: > > >> 1. If config.action_controller.whatever is not nil > >> 2. and config.action_mailer.whatever is nil > >> 3. then config.action_mailer.whatever should use > >> config.action_controller.whatever as a default > > >> This approach could be extended to all of the action_ and active_ > >> components. > > > For both action_controller and action_mailer, it would make more sense > > to fallback to whatever is in abstract_controller. I''m not sure there > > is a config.abstract_controller, though. > > > Jeremy > > I also think they should both fallback to a common setting, rather > than action_mailer falling back to action_controller. > config.abstract_controller makes a certain amount of sense, but it''ll > probably be a bit confusing to those who don''t fully understand rail''s > class structure. How about simply defining config.asset_host ? > > > > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails- > > core@googlegroups.com. > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com > > . > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-core?hl=en > > .-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-core?hl=en.
Seemingly Similar Threads
- can't compile assets on prod due to asset_host config && SSL requirement
- #asset_url helper method
- Anyone having problems with asset_host not getting set up right?
- Rails 3 Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2)
- Rails 3 Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2)