mercredi 8 septembre 2021

How to add value on current field in devise

Good day ! Im trying to access the fields in my devise

This is my migration file for devise user

 class DeviseCreateUsers < ActiveRecord::Migration[6.1]

    def change
      create_table :users do |t|
        ## Database authenticatable
        t.string :email,              null: false, default: ""
        t.string :encrypted_password, null: false, default: ""
        t.integer :current_points ,default:0
        t.timestamps null: false
    end

 add_index :users, :email,                unique: true
 add_index :users, :reset_password_token, unique: true
 # add_index :users, :confirmation_token,   unique: true
 # add_index :users, :unlock_token,         unique: true
 end

end

I want to be able to add value in current_points field instead of editing it . Im trying to make an app where user can add points from index.html.erb without refreshing the page.

Thanks for the help

Aucun commentaire:

Enregistrer un commentaire