Ruby/Rails syntax
  • Index
  • chap 1
  • chap 2
  • chap 3
  • chap 4
  • Enterprise Rails - big picture
  • Nokogiri
  • ActiveRecord - 進階功能
  • pack & unpack
  • performance
  • rails engine
  • jsonb / json / hstore
  • Deploy
  • Polymorphism/Polymorphic Associations
  • relationship
  • rvm / ENV
  • Auth
  • DB related
  • TODO N+1
  • SQL view
  • module
  • api + create-react-app
  • ONE_LINE
  • Delete & destroy association
Powered by GitBook
On this page
  • Rails: ActiveModel, ActiveRecord and ActiveResource
  • Rails: Action Pack

Was this helpful?

chap 4

Rails: ActiveModel, ActiveRecord and ActiveResource

ActiveModel + Database Support = ActiveRecord

ActiveModel via WebService API = AcitveResource

ActiveModel: all the model related without db. (Ex: validations).

ActiveRecord: associates a class to the database. (Ex: find method).

ActiveResource: Similar to ActiveRecord. However, instead of being backed by a database, an ActiveResource object is backed by another application through a web service API.

Rails: Action Pack

Action Pack: From request to response -> provides the view and controller layers.
|
|- Action Dispatch: parses request, handles routing, cookies and sessions.
|- Action Controller
Previouschap 3NextEnterprise Rails - big picture

Last updated 5 years ago

Was this helpful?