# Link\_to\_remote with :confirm...need syntax help

**URL:** <https://www.ruby-forum.com/t/link-to-remote-with-confirm-need-syntax-help/104180>\
**Category:** Rails\
**Created:** [May 15, 2007, 4:32am UTC](https://www.ruby-forum.com/t/link-to-remote-with-confirm-need-syntax-help/104180 "2007-05-15T04:32:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![suer\_rick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@suer\_rick](https://www.ruby-forum.com/u/suer_rick)\
**Post date:** [May 15, 2007, 4:32am UTC](https://www.ruby-forum.com/t/link-to-remote-with-confirm-need-syntax-help/104180/1 "2007-05-15T04:32:47Z")

</div>

What is the syntax to use :confirm with link\_to\_remote? This doesn’t  
work, I’ve tried a few permutations, with no success:

```
  <%= link_to_remote( "X",
       :update => 'address_list',
       :url => { :controller => 'addresses', :action =>

```

‘destroy’, :id =\> address },  
:confirm =\> true ) %\>

The above works fine if I remove the :confirm part.

---

<div class="post-metadata">

**Author:** ![suer\_rick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@suer\_rick](https://www.ruby-forum.com/u/suer_rick)\
**Post date:** [May 15, 2007, 4:46am UTC](https://www.ruby-forum.com/t/link-to-remote-with-confirm-need-syntax-help/104180/2 "2007-05-15T04:46:47Z")

</div>

On May 14, 2007, at 10:30 PM, Rick S. wrote:

> What is the syntax to use :confirm with link\_to\_remote? This doesn’t  
> work, I’ve tried a few permutations, with no success:
> 
> ```
> <%= link_to_remote( "X",
> :update => 'address_list',
> :url => { :controller => 'addresses', :action =>
> 
> ```
> 
> ‘destroy’, :id =\> address },  
> :confirm =\> true ) %\>
> 
> The above works fine if I remove the :confirm part.

Try:

:confirm =\> “Should I really destroy the address #{address}?”

The value is a string that will be shown in an alert box.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
