Monday, December 17, 2012

[Rails] callbacks

Hello All,

I have two tables:
user has_many room
room belongs_to user

When a new user is created, I want to save the room through some default values at the same time.
How to do this by using callbacks?

after_save or after_create ?
& I want to use blocks with callbacks.

Any suggestions??


Thanks,
Avi

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/UrFJjpp9RX4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate