Skip to content

Instantly share code, notes, and snippets.

@thomasstr
Created March 14, 2013 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasstr/5159964 to your computer and use it in GitHub Desktop.
Save thomasstr/5159964 to your computer and use it in GitHub Desktop.
Getting error in purchase_controller.rb:37:in `credit' Line 4 here.
undefined method `on' for #<ActiveModel::Errors:0x007ff72d404300>
def credit
render :action => 'index' and return unless @cc.valid?
@response = paypal_gateway.purchase(price_in_cents, @cc,
:ip => request.remote_ip,
:billing_address => params[:billing_address])
if @response.success?
@purchase = Purchase.create(:response => @response)
redirect_to :action => "complete", :id => @purchase
else
paypal_error(@response)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment