inf:rails:notes
Kontroler udostępnia widokowi tylko zmienne obiektu (instance variable, poprzedzony symbolem @
).
Jeśli chcemy udostępnić coś wszystkim kontrolerom, umieszczamy to w ApplicationController
(app/controllers/application_controller.rb
).
t.timestamps
, is a special command that creates two magic columns called created_at
and updated_at
.
User.create!
(read “create bang”) works just like the create
method except that it raises an ActiveRecord::Record-Invalid exception if the creation fails.
-
-
-
-
-
-
-
-
inf/rails/notes.txt · Last modified: 2021/02/16 09:56 (external edit)