Rails 3.1.3
I would like to pass the value in an input form to a parameter in function.
The value is to be set in
<%= text_field_tag :price %>
A PayPal official icon initiates the action, 'checkout'.
<%= link_to image_tag("https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif"\), :action => 'checkout' %>
Clicking the icon above should pass the value entered in the form. I tried the following
def checkout contribution = params[:price] setup_response = EXPRESS_GATEWAY.setup_purchase(contribution, ... ) redirect_to EXPRESS_GATEWAY.redirect_url_for(setup_response.token) end
And a callback function as well.
def complete contribution = params[:price] purchase = EXPRESS_GATEWAY.purchase(contribution, ... end end
But the transaction gives an error saying the value is empty. I guess that I am not passing the input value properly.
Could anyone show me how to set the local(?) variable that can be passed to the function, 'checkout' as well as 'complete' ???
soichi