Link_to

I am trying to use an encrypted request to PayPal using my own submit
button link
I googled a little but, but could not find a clear & neat solution, so
I ended writing this :

== Rails 2.3.8 script code ====

<% form_tag APP_CONFIG[:paypal_url], {:id => ‘form_paypal’} do %>
<%= hidden_field_tag :cmd, “_s-xclick” %>
<%= hidden_field_tag :encrypted, @cart.paypal_encrypted(root_url,
payment_notifications_url(:secret => APP_CONFIG[:paypal_secret])) %>

<%= link_to_function “OK”, “$(‘form_paypal’).submit()” , :class
=> ‘buy’ %>


<% end %>

The display is fine (I get my button…), the generated code seems ok,
but when I hit the button, nothing happen…

=== generated source code ====

OK

where am I wrong ?

[SOLVED] I realized that I was using jQuery and not Prototype
anymore …
so the link_to function was not right and should have been written
with the correct jQuery id # : (’#form_paypal’).submit()

<%= link_to_function “OK”, “$(’#form_paypal’).submit()” , :class =>
‘buy’ %>

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