diff --git a/db/migrate/20250321234644_create_users.rb b/db/migrate/20250321234644_create_users.rb new file mode 100644 index 0000000..7367989 --- /dev/null +++ b/db/migrate/20250321234644_create_users.rb @@ -0,0 +1,9 @@ +class CreateUsers < ActiveRecord::Migration[7.2] + def change + create_table :users do |t| + t.string :email + t.string :password + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index ca192cc..c61f9f7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2025_03_21_224552) do +ActiveRecord::Schema[7.2].define(version: 2025_03_21_234644) do create_table "candidates", force: :cascade do |t| t.integer "vote_id" t.string "name" @@ -20,6 +20,13 @@ ActiveRecord::Schema[7.2].define(version: 2025_03_21_224552) do t.index ["vote_id"], name: "index_candidates_on_vote_id" end + create_table "users", force: :cascade do |t| + t.string "email" + t.string "password" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "votes", force: :cascade do |t| t.string "secure_id" t.string "title" diff --git a/views/login.erb b/views/login.erb index dc175d7..ebd8a03 100644 --- a/views/login.erb +++ b/views/login.erb @@ -3,7 +3,14 @@

<%= @error %>

<% end %>
- - - +

+ + +

+

+ + +

+
+Create account diff --git a/views/signup.erb b/views/signup.erb new file mode 100644 index 0000000..72e4551 --- /dev/null +++ b/views/signup.erb @@ -0,0 +1,13 @@ +

Create account

+ +
+

+ + +

+

+ + +

+ +
diff --git a/views/votes_show.erb b/views/votes_show.erb index 56cbde3..3d3263f 100644 --- a/views/votes_show.erb +++ b/views/votes_show.erb @@ -2,6 +2,8 @@

<%= @vote.description %>

+

Hello, <%= current_user.email %>.

+

Candidates