Forum: Ruby (newbie) Why doesn't this line work?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eddie S. (Guest)
on 2006-06-08 14:32
<td><%= link_to 'Edit', :confirm => 'Are you sure?', :action => 'edit',
:id => product %></td>

Why doesn't this work the way it should, which is (from my
understanding)
1. link something to edit
2. before going to the edit page, asking 'are you sure?'

Help.
Vlad GALU (Guest)
on 2006-06-08 14:39
(Received via mailing list)
On 6/8/06, Dominic S. <removed_email_address@domain.invalid> wrote:
> <td><%= link_to 'Edit', :confirm => 'Are you sure?', :action => 'edit',
> :id => product %></td>
>
> Why doesn't this work the way it should, which is (from my
> understanding)
> 1. link something to edit
> 2. before going to the edit page, asking 'are you sure?'

  :confirm belongs to html_options. It should look like link_to
'Edit', { :action => 'edit', :id => product }, { :confirm => 'Are you
sure?' }
Eddie S. (Guest)
on 2006-06-08 15:22
Vlad GALU wrote:
> On 6/8/06, Dominic S. <removed_email_address@domain.invalid> wrote:
>> <td><%= link_to 'Edit', :confirm => 'Are you sure?', :action => 'edit',
>> :id => product %></td>
>>
>> Why doesn't this work the way it should, which is (from my
>> understanding)
>> 1. link something to edit
>> 2. before going to the edit page, asking 'are you sure?'
>
>   :confirm belongs to html_options. It should look like link_to
> 'Edit', { :action => 'edit', :id => product }, { :confirm => 'Are you
> sure?' }

Nice, thanks.

Does anyone have a tree of nods/level/structure of where and how these
objects should go?

Thanks
Rida Al Barazi (Guest)
on 2006-06-08 16:02
(Received via mailing list)
On 6/8/06, Dominic S. <removed_email_address@domain.invalid> wrote:
> >
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
The best place to go is http://api.rubyonrails.com/ For example in your
case
you could visit:
http://api.rubyonrails.com/classes/ActionView/Help...
Note that parameters are passed as hashes, so it's important to
distinguish
between them while passing.

Regards
Rida Al Barazi
http://www.ridaalbarazi.com
This topic is locked and can not be replied to.