I am using ''redmine'' (v 0.6) as my major project manager, seems running fine w Rails 2.0 (slight modifs for paginations..) but I am stuck with a major error when sending a confirmation email : mailer.rb class Mailer < ActionMailer::Base .... # Renders a message with the corresponding layout def render_message(method_name, body) layout = method_name.match(%r{text\.html\.(rhtml|rxml)}) ? ''layout.text.html.rhtml'' : ''layout.text.plain.rhtml'' body[:content_for_layout] = render(:file => method_name, :body => body) ActionView::Base.new(File.join(template_root, ''mailer''), body, self).render(:file => layout) end end the last line is not accepted when running rails 2.0 => ERROR ActionView::ActionViewError (Due to changes in ActionMailer, you need to provide the mailer_name along with the template name. render "user_mailer/signup" render :file => "user_mailer/signup" If you are rendering a subtemplate, you must now use controller-like partial syntax: render :partial => ''signup'' # no mailer_name necessary) in debugging mode, I got : File.join(template_root, ''mailer'') => ''my_redmine_path/app/views/mailer layout => "layout.text.html.rhtml" body => { ... :url .. ::content_for_layout... , :token... } seems OK I don''t know how to render correctly as rails 2.0 ActionMailer seems to expect it ... any patch ? thanks for your help -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rick Olson
2007-Dec-08 18:04 UTC
Re: Rails 2.0 ActionMailer breaks my redmine render_message
On 12/8/07, Kad Kerforn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am using ''redmine'' (v 0.6) as my major project manager, seems running > fine w Rails 2.0 (slight modifs for paginations..) but I am stuck with a > major error when sending a confirmation email : > > mailer.rb > class Mailer < ActionMailer::Base > .... > # Renders a message with the corresponding layout > def render_message(method_name, body) > layout = method_name.match(%r{text\.html\.(rhtml|rxml)}) ? > ''layout.text.html.rhtml'' : ''layout.text.plain.rhtml'' > body[:content_for_layout] = render(:file => method_name, :body => > body) > ActionView::Base.new(File.join(template_root, ''mailer''), body, > self).render(:file => layout) > end > end > > the last line is not accepted when running rails 2.0 => ERROR > ActionView::ActionViewError (Due to changes in ActionMailer, you need to > provide the mailer_name along with the template name. > render "user_mailer/signup" > render :file => "user_mailer/signup" > If you are rendering a subtemplate, you must now use controller-like > partial syntax: > render :partial => ''signup'' # no mailer_name necessary) > > in debugging mode, I got : > > File.join(template_root, ''mailer'') => ''my_redmine_path/app/views/mailer > layout => "layout.text.html.rhtml" > body => { ... :url .. ::content_for_layout... , :token... } seems OK > > I don''t know how to render correctly as rails 2.0 ActionMailer seems to > expect it ... > any patch ? > > thanks for your helpAs the exception message states, you now need to provide the mailer name along with the template name. Sorry for the change in 2.0, but this makes ActionMailer a little more consistent with ActionPack as far as rendering goes. I believe this is the line that''s causing you issues: body[:content_for_layout] = render(:file => method_name, :body => body) method_name is no longer sufficient, you''ll need the mailer name too. Maybe "#{mailer_name}/#{method_name}" ? I don''t use redmine so I wouldn''t know. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kad Kerforn
2007-Dec-08 18:45 UTC
Re: Rails 2.0 ActionMailer breaks my redmine render_message
Rick Olson wrote: As the exception message states, you now need to provide the mailer> name along with the template name. Sorry for the change in 2.0, but > this makes ActionMailer a little more consistent with ActionPack as > far as rendering goes. I believe this is the line that''s causing you > issues: > > body[:content_for_layout] = render(:file => method_name, :body => > body) > > method_name is no longer sufficient, you''ll need the mailer name too. > Maybe "#{mailer_name}/#{method_name}" ? I don''t use redmine so I > wouldn''t know. >Thanks Rick, I tried, but it''s not it.. I''am going to give up from redmine for a while, until it will the developers test it w 2.0... back to Trac ! this render_message is specific to redmine and take precedence over ActionMailer base render_message so I don''t actually understand how this line is performing and for what purpose , im my own dev, I tsick to standard rails mailer actions.. and it works.... they tried to be smart, but too smart maybe for 2.0 ActionView::Base.new(File.join(template_root, ''mailer''), body, self).render(:file => layout) File.join(template_root, ''mailer'') this is the full path to the mailer views : "..../redmine/app/views/mailer" ActionView::Base.new("the_views_mailer_path", body, self) creates an ActionView::Base THIS I don''t understand very well.. as I could not grab the description of ActionView::Base.new (too indepth for my present level of rails knowledge) this new ActionView::Base is rendered with a layout...(:file => layout) this is the problem... (I run a breakpoint at this line...) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marcelo Barbudas
2007-Dec-09 18:51 UTC
Re: Rails 2.0 ActionMailer breaks my redmine render_message
> the last line is not accepted when running rails 2.0 => ERROR > ActionView::ActionViewError (Due to changes in ActionMailer, you need to > provide the mailer_name along with the template name. > render "user_mailer/signup" > render :file => "user_mailer/signup" > If you are rendering a subtemplate, you must now use controller-like > partial syntax: > render :partial => ''signup'' # no mailer_name necessary) >I get the same error but I am not using redmine. This is the function: def signup_notification(user) recipients user.email from "From <user-Jbz+COfnBihBDgjK7y7TUQ@public.gmane.org>" subject ''Please activate your new account'' body :url => "activation_url", :user => user end If I add: render "user_notifier/signup_notification" it returns: can''t convert Symbol into String If I add render :file => "user_notifier/signup_notification" it returns: Couldn''t find template file for user_notifier/signup_notification in "/path/app/views/user_notifier" -- M. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marcelo Barbudas
2007-Dec-09 20:14 UTC
Re: Rails 2.0 ActionMailer breaks my redmine render_message
> the last line is not accepted when running rails 2.0 => ERROR > ActionView::ActionViewError (Due to changes in ActionMailer, you need to > provide the mailer_name along with the template name. > render "user_mailer/signup" > render :file => "user_mailer/signup" > If you are rendering a subtemplate, you must now use controller-like > partial syntax: > render :partial => ''signup'' # no mailer_name necessary)>I get the same error but I am not using redmine. This is the function: def signup_notification(user) recipients user.email from "From <user-Jbz+COfnBihBDgjK7y7TUQ@public.gmane.org>" subject ''Please activate your new account'' body :url => "activation_url", :user => user end If I add: render "user_notifier/signup_notification" it returns: can''t convert Symbol into String If I add render :file => "user_notifier/signup_notification" it returns: Couldn''t find template file for user_notifier/signup_notification in "/ path/app/views/user_notifier" -- M. P.S. Sorry if this email arrives twice. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jean-philippe Lang
2007-Dec-10 21:03 UTC
Re: Rails 2.0 ActionMailer breaks my redmine render_message
Kad Kerforn wrote:> I am using ''redmine'' (v 0.6) as my major project manager, seems running > fine w Rails 2.0 (slight modifs for paginations..) but I am stuck with a > major error when sending a confirmation emailProblem is fixed in Redmine r975 (or 0.6.1). It''s now Rails 2.0 compatible. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I got the same problem using Acts As Authenticated plugin. I don''t know the reason why, but when I commented out the following line in config/environment.rb, ActionMailer stopped complaining. # RAILS_GEM_VERSION = ''2.0.2'' unless defined? RAILS_GEM_VERSION On Dec 10 2007, 9:03 pm, Jean-philippe Lang <rails-mailing- l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Kad Kerforn wrote: > > I am using ''redmine'' (v 0.6) as my major project manager, seems running > > fine w Rails 2.0 (slight modifs for paginations..) but I am stuck with a > > major error when sending a confirmation email > > Problem is fixed in Redmine r975 (or 0.6.1). > It''s now Rails 2.0 compatible. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---