Ruby on Rails Thursday, July 1, 2010

Colin Law wrote:
> On 30 June 2010 23:45, Neil Bye <lists@ruby-forum.com> wrote:
>>> @story.id? �You could just display it on the page
>>
You can
> also look at the html of the page (view page source in browser) to
> check that the id is there in the href.
>
> Add code to show the id on the page and check that it also appears in
> the href.
>
> Colin

This is from show.html.erb

<%= @story.id %>
<%= link_to "Email this user",
:controller => "email", :action => "correspond" , :id => "@story_id"
%>

This is view source

2
<a href="/email/correspond/@story_id">Email this user</a>

This is the error that results

Couldn't find Story with ID=@story_id

Where am I going wrong
--
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