Link_to_remote sumbit_to_remote

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?

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?

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

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?

On Apr 18, 2:19 am, edberner [email protected] 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

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.
<[email protected]

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs