12月14日 bs-grid , destroy_all()

bootstrap Grid :

The Bs grid system has four classes: xs (phones), sm (tablets), md (desktops), and lg (larger desktops).

The classes can be combined to create more dynamic and flexible layouts.

 

.clearfix: clear floats at specific breakpoints to prevent strange wrapping with uneven content. 


destroy_all)

Delete the records of the collection directly from the database ignoring the :dependent Option.

class Person < ActiveRecord::Base
  has_many :pets
end

person.pets.size # => 3
person.pets
# => [
#       #<Pet id: 1, name: "Fancy-Fancy", person_id: 1>,
#       #<Pet id: 2, name: "Spook", person_id: 1>,
#       #<Pet id: 3, name: "Choo-Choo", person_id: 1>
#    ]

person.pets.destroy_all

person.pets.size # => 0
person.pets      # => []

Pet.find(1) # => Couldn't find Pet with id=1

 

posted @ 2017-12-14 08:48  Mr-chen  阅读(141)  评论(0编辑  收藏  举报