# Link\_to\_remote sumbit\_to\_remote

**URL:** <https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168>\
**Category:** Rails\
**Created:** [April 18, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168 "2008-04-18T18:41:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 18, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168/1 "2008-04-18T18:41:25Z")

</div>

Why is it that  
\<%= link\_to\_remote “add round”, :url =\> { :action  
=\> :add\_round }, :class =\> “blueL”, :update =\> “rounds”, :method =\>  
“put” %\>  
works while  
\<%= submit\_to\_remote ‘name’, “add round”, :url =\> { :action  
=\> :add\_round }, :html =\> { :class =\> “blueL” }, :update =\>  
“rounds”, :method =\> “put” %\>  
does not?

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 18, 2008, 7:24pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168/2 "2008-04-18T19:24:17Z")

</div>

edberner wrote:

> Why is it that  
> \<%= link\_to\_remote “add round”, :url =\> { :action  
> =\> :add\_round }, :class =\> “blueL”, :update =\> “rounds”, :method =\>  
> “put” %\>  
> works while  
> \<%= submit\_to\_remote ‘name’, “add round”, :url =\> { :action  
> =\> :add\_round }, :html =\> { :class =\> “blueL” }, :update =\>  
> “rounds”, :method =\> “put” %\>  
> does not?

What do you mean by “doesn’t work”?

Got an error message?

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 18, 2008, 7:37pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168/3 "2008-04-18T19:37:47Z")

</div>

It’s just not functional. I want it to render a partial in the rounds  
id, while adding the models to the database.

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 18, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168/4 "2008-04-18T19:42:06Z")

</div>

Ellis B. wrote:

> It’s just not functional.

Hmm… gonna need more information than that.

1. Have you checked your development log?
2. Do you have the Firebug extension for Firefox to look at the content  
of the Ajax request?
3. Did you include the correct JavaScript files?

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 18, 2008, 8:08pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168/5 "2008-04-18T20:08:58Z")

</div>

On Apr 18, 2:19 am, edberner [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Why is it that  
> \<%= link\_to\_remote “add round”, :url =\> { :action  
> =\> :add\_round }, :class =\> “blueL”, :update =\> “rounds”, :method =\>  
> “put” %\>  
> works while  
> \<%= submit\_to\_remote ‘name’, “add round”, :url =\> { :action  
> =\> :add\_round }, :html =\> { :class =\> “blueL” }, :update =\>  
> “rounds”, :method =\> “put” %\>  
> does not?

Is your submit\_to\_remote in a form ? it won’t work if it’s not (since  
what it does is submit its form to the specified URL)

Fred

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 18, 2008, 10:34pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168/6 "2008-04-18T22:34:38Z")

</div>

No… So I _must_ use link\_to? Cause I don’t see a button to remote.

On Apr 18, 2008, at 5:37 AM, Frederick C.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 18, 2008, 11:38pm UTC](https://www.ruby-forum.com/t/link-to-remote-sumbit-to-remote/135168/7 "2008-04-18T23:38:00Z")

</div>

On 18 Apr 2008, at 13:02, Ellis B. wrote:

> No… So I _must_ use link\_to? Cause I don’t see a button to remote.

There’s always button\_to\_function(‘Foo’, remote\_function(…)). Or  
style the link to look like a button.

Fred
