ruby on rails - Could Not Find Table 'Name' -
i'm new ruby , can't solve problem. tried troubleshooting solutions in similar posts , none fixed problem. hoping might have idea on what's wrong. when attempt login, i'm told cannot find table name'
. i'm able create user in rails console , able locate via user.find_by(name: "")
. shows in database.
def create user = user.find_by(name: params[:session]) if user && user.authenticate(params[:session][:password]) else flash.now[:danger] = 'invalid username/password combination' render 'new' end end
migration:
class createusers < activerecord::migration def change create_table :users |t| t.string :name t.timestamps null: false end end end
you have not provided key :name
:
user = user.find_by(name: params[:session][:name])
Comments
Post a Comment