Search code examples
ruby-on-railsruby

Where is the email for user


rails generate scaffold User email:string

Model is empty.

class User < ApplicationRecord
end

Controller

  def create
    @user = User.new(user_params)

    ...
  end

Table:

create_table :users do |t|
  t.string :email
  t.timestamps
end

How it works? And whether there is a plugin for ide to navigate?


Solution

  • Ruby on Rails impelements the Active Record Pattern

    This is the full guide of Rails Active Record