Ruby on Rails
Tuesday, June 29, 2010
On 29 June 2010 11:00, Neil Bye <lists@ruby-forum.com> wrote:
-- I have this bit of code in my email.controller
user = @current_user
story = @current_story
recipient = story.user
It doesn't work because @current_story isn't defined. How can I find the
current page to make this work?
You haven't given anywhere enough detail for us to help you.
@current_story - what are you expecting this variable to contain? Saying "the current page" won't help. Do you mean the current URL (@request.request_uri)? The current Page object (in which case you must have found the Page object using some code, assign that to @current_story. A variable from the session? @current_story = session[:current_story].
We need a lot more information to be able to help. @current_story is an instance variable, but there's no information on what you're expecting it to magically contain.
Cheers,
Andy
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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment