nanaya wrote in post #1183942:
Hi
nothing less.
Hi
On Sun, Jun 12, 2016, at 16:03, David Alejandro wrote:
class Order < ActiveRecord::Base
def paypal_url(return_url, notify_url)
# ... Do stuff
self.update_attribute(:payment_in_process, true)
# Do more stuff...
end
When I visit the view, the model gets its attribute updated. I do not
want this. I only want the attribute updated if the link is clicked.
You call the method in the view, thus the method is run. Nothing more,class Order < ActiveRecord::Base
def paypal_url(return_url, notify_url)
# ... Do stuff
self.update_attribute(:payment_in_process, true)
# Do more stuff...
end
When I visit the view, the model gets its attribute updated. I do not
want this. I only want the attribute updated if the link is clicked.
nothing less.
clicked?
--
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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9459b1a8bcb06a31a041687bb12f70fd%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.