Mention the differences between the observers and callbacks in ruby on rails.

devquora
devquora

Posted On: Feb 22, 2018

 

Following are the differences between observers and callbacks in ruby on rails: –
  • Rails observers: these are same as callbacks but are used when the method is not directly associated to the life cycle of the object. It lives for a longer duration of time and can be attached or detached at any time.
  • Rails callback: the callback methods can only be called at only certain points of time in the life cycle of an object like validation, creation, updating, deletion, etc. Unlike the rails observers, the rails callback lives for only a short period of time.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Ruby on Rails Interview Questions

    Mention all the naming conventions in ruby on rails.

    Following is a list of some naming conventions used in ruby on rails:Variables– it is used for the declaration of v..

    Ruby on Rails Interview Questions

    Explain the features of ruby on rails.

    Some of the features of ruby on rails are listed below-Meta-programming: code generation is used but for heavy liftin..

    Ruby on Rails Interview Questions

    How is the model view controller framework used in ruby on rails?

    The web development is usually divided into three subsystems closely integrated to each other. They are: –Model (ac..