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
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.