Michael Pavling wrote:
> On 28 June 2010 11:37, Neil Bye <lists@ruby-forum.com> wrote:
>> Michael Pavling wrote:
>>
>>>
>>> :recipient => @story.user.email_address
>>
>> That gives undefined method `user' for nil:NilClass
>
> If you have a Story object somewhere, and the story instance has a
> user, and that user has an email address, you can pass it into your
> ActionMailer method as a parameter (or, as it looks like you're doing,
> a hash value). You can then set that passed-in email address as the
> "recipients" for the email.
How would I send it as a parameter then if it won't accept my hash?.
Problem is that it won't recognise the Story object. Doesn't it need to
be related?
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment