Ruby on Rails Thursday, July 1, 2010

On 1 July 2010 09:41, Neil Bye <lists@ruby-forum.com> wrote:
> 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"

That is passing the string "@story_id" as the id, you want the value,
so just :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

You should have been able to work it out from this, it is getting the
string @story_id instead of 2

Colin

>
> Where am I going wrong

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

Ruby on Rails

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.

Ruby on Rails

Hi,

I am fighting to install Redmine therefore I need to install Ruby on
Rails to a machine behind many firewalls. OS is RHEL.

My idea was to download the packages, make and install...

There was some difficulties because the latest Ruby in the RHEL repo was
not modern enough for gem. So I donwloaded the source of ruby. Its
intall was perfect. After that point I managed to install gem.


But since this, I have no idea how can I install the rake, rail, etc.
packages with gem from local files because the firewalls do not allowe
me public internet connection in this host.

Can you help me?


Best Regards,

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