[Rails] Re: link_to_remote where the url contain a javascript variab

Didier Prophete
2006-01-15T02:54:56Z

Ok, so after thinking for some time, I came up with this SUPER UGLY
solution:

  <%= form_remote_tag :update => ''my_div'',
         :before => "$(''hidden_tag'').value =
my_var",
         :url => { :action => "my_action" } %>
  <%= hidden_field_tag ''my_var'', 0, :id =>
''hidden_tag'' %>
  <%= submit_tag ''Go'' %>
  <%= end_form_tag %>

The idea is to submit a form with a hidden field which gets updated
right before you submit (with the value of ''my_var''), but this
is so
ugly... I am ashamed of myself :-)

Somebody''s got to have a better solution for this...