I am learning Ruby on Rails Tutorial, I finished chapter 7 and it works well, but stumbled upon 25 crashes / errors, such as:
User Error / error: @user = User.new (name: "User example", email: " user@example.com ", ActiveRecord :: StatementInvalid: Could not find table users. #. / Spec / models / user_spec.rb : 18: in new' # ./spec/models/user_spec.rb:18:in
block (2 levels) in'
This is user_controller.rb
class UsersController < ApplicationController def new @user = User.new end def show @user = User.find(params[:id]) end def create @user = User.new(params[:user]) if @user.save flash[:success] = "Welcome to the Sample App!" redirect_to @user else render 'new' end end end
Thanks for your help.
source share