activerecord - Pass custom argument to rails event model callbacks? -


very simple question unable figure out. possible like:

  after_create    :log_activity(my_var) 

so write 1 method handles actions ( destroy,save,update)?

no, not possible pass variables callback method. reason simple callback methods called rails stack , when call callback method, did't know pass in callback method.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -