We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
app/models/note.rb
class Note < ActiveRecord::Base belongs_to :user end
app/models/user.rb
class User < ActiveRecord::Base has_secure_password has_many :notes validates :password, length: { :minimum => 8 } end
bin/rails g migration create_notes
class CreateNotes < ActiveRecord::Migration def change create_table :notes do |t| t.string :title t.text :body_html t.text :body_text t.references :user, index: true t.timestamps end end end
bin/rake db:migrate
Commit.
$ git add . $ git commit -m "Add Note model"
There was an error while loading. Please reload this page.