Ruby on Rails Wednesday, May 30, 2018



On Wednesday, May 30, 2018 at 11:56:34 AM UTC-4, Colin Law wrote:
On 30 May 2018 at 16:03, fugee ohu <fuge...@gmail.com> wrote:
controller by POST from form with inputs for 'subject' and 'message' (message is the body)
  def mail_to_confirmed_users0 @message=params[:message] subject=params[:subject] User.where("confirmed_at is not null").each do |user| AdminGeneralMailer.mail_to_confirmed_users(user: user, subject: subject, message: @message).deliver_now end end
mailer:

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]
    mail(to: @user.email, subject: @subject)
  end


And the full error message is?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ab16a4-553f-4337-82a0-9dcd5a0ad307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I just needed to pass a sequence of arguments in the call to the mailer from  controller and match them with same sequence in parentheses next to my mailer action's definition If you know what I mean =D

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d2f0aa70-992e-45bd-9151-35839e2d235e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment