-3

Am totally new to ruby on rails... I've followed this discussion --> Ruby on Rails 4, Devise, and profile pages. And i scaffolded profile, Yet got an error click here for image

any thoughts??

Community
  • 1
  • 1
santhosh kumar
  • 133
  • 1
  • 7

1 Answers1

0

Seems to me like You don't have user_id attribute in Your profiles_table. Check again Your migration.

WRK
  • 311
  • 2
  • 6
  • class CreateProfiles < ActiveRecord::Migration
    def change
    create_table :profiles do |t|
    t.timestamps null: false
    end
    end
    end -->this is profiles table and i don't have any user_id there what should i do??
    – santhosh kumar Feb 23 '16 at 14:46
  • Add `t.integer :user_id, null: false` to your migration, rollback previous one and you should be good. BTW I think you should read http://guides.rubyonrails.org/association_basics.html You may also have other pending issues, but your associations are wrong for sure. – WRK Feb 23 '16 at 16:00