Ruby on Rails Wednesday, June 30, 2010

Neil Bye wrote:
>> The email is to be sent from a page containing a story and comments. I
>> want it to go to @story.user's email. If I use story=
>> Story.find_by_id(2) it works but I want an expression to find the
>> current story not one specified.
>> Does that tell you enough? Do you want more files sent?

I assume you have a show page that contains the story and the comments.

How are you triggering the email from that form? A hyperlink I assume?
If that's the case, just pass the current story id as a parameter on the
link_to, which makes that id available in the controller for your
Story.find(params[:id]) or something close to that.

--
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