Reputation: 115
so i am trying to create a signup script i am using steps i found on Codecademy but for some reason it is not working.
Below is the "New" page for registration
<div class="login">
<div class="container">
<div class="form">
<h1>Sign up</h1>
<%= form_for(@user) do |f| %>
<%= f.text_field :first_name, :placeholder => "First name" %>
<%= f.text_field :last_name, :placeholder => "Last name" %>
<%= f.email_field :email, :placeholder => "Email" %>
<%= f.password_field :password, :placeholder => "Password" %>
<%= f.submit "Create an account", class: "btn-submit" %>
<% end %>
</div>
Here is my Users controller
class UsersController < ApplicationController
def new
@user = User.new
end
end
and the user model
class User < ApplicationRecord
has_secure_password
end
and finally my db:migrate file for my users
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.string :password_digest
t.timestamps
end
end
end
Upvotes: 0
Views: 71
Reputation:
Before you edit a migration you need to run rake db:rollback
and then once you edit it you need to run rake db:migrate
.
Upvotes: 1