# (newbie) Why doesn't this line work?

**URL:** <https://www.ruby-forum.com/t/newbie-why-doesnt-this-line-work/95659>\
**Category:** Ruby\
**Created:** [June 8, 2006, 12:32pm UTC](https://www.ruby-forum.com/t/newbie-why-doesnt-this-line-work/95659 "2006-06-08T12:32:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [June 8, 2006, 12:32pm UTC](https://www.ruby-forum.com/t/newbie-why-doesnt-this-line-work/95659/1 "2006-06-08T12:32:07Z")

</div>

\<%= link\_to 'Edit', :confirm =\> 'Are you sure?', :action =\> 'edit', :id =\> product %\>

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.

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [June 8, 2006, 12:39pm UTC](https://www.ruby-forum.com/t/newbie-why-doesnt-this-line-work/95659/2 "2006-06-08T12:39:26Z")

</div>

On 6/8/06, Dominic S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \<%= link\_to 'Edit', :confirm =\> 'Are you sure?', :action =\> 'edit', :id =\> product %\>
> 
> 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?’ }

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [June 8, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/newbie-why-doesnt-this-line-work/95659/3 "2006-06-08T13:22:05Z")

</div>

Vlad GALU wrote:

> On 6/8/06, Dominic S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > \<%= link\_to 'Edit', :confirm =\> 'Are you sure?', :action =\> 'edit', :id =\> product %\>
> > 
> > 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

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [June 8, 2006, 2:02pm UTC](https://www.ruby-forum.com/t/newbie-why-doesnt-this-line-work/95659/4 "2006-06-08T14:02:32Z")

</div>

On 6/8/06, Dominic S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

The best place to go is [http://api.rubyonrails.com/](http://api.rubyonrails.com/) For example in your  
case  
you could visit:  
[Peak Obsession](http://api.rubyonrails.com/classes/ActionView/Helpers/UrlHelper.html#M000378)  
Note that parameters are passed as hashes, so it’s important to  
distinguish  
between them while passing.

Regards  
Rida Al Barazi

> **[Rida Al Barazi on about.me](https://about.me/rida)**
>
> I am an Entrepeneur in Toronto, Ontario, Canada. Visit my company website.
