CRUD
Create
Post.create(name: "Granite Rocks!", body: "Check this out.") # Set attributes and call save
Post.create!(name: "Granite Rocks!", body: "Check this out.") # Set attributes and call save!. Will throw an exception when the save failedInsert
post = Post.new
post.name = "Granite Rocks!"
post.body = "Check this out."
post.save
post = Post.new
post.name = "Granite Rocks!"
post.body = "Check this out."
post.save! # raises when save failedRead
find
find_by
first
where, order, limit, offset, group_by
all
Update
Delete
Last updated