error: thrown from the form
undefined method `profession_id' for #<DirectoryMember:0xa12be40>
env:
Rails: 5.0.0.1
Ruby: 2.2.4
form.html.erb
<%= f.collection_select(:profession_id, @professions, :id, :title, {:include_blank => true, :prompt => true}) %>
routes.rb
resources :directory_members
directory_members.rb
@professions = Profession.all.order(:title)
def directory_member_params
params.require(:directory_member).permit(
:user_id,
:directory_id,
:name,
:company,
:profession_id,
:address,
:phone,
:facebook,
:video,
:twitter,
:linkedin,
:google_plus,
:youtube
)
end
schema.rb
create_table "directory_members", force: :cascade do |t|
t.integer "user_id"
t.integer "directory_id"
t.string "name"
t.string "company"
t.text "address"
t.string "phone"
t.string "facebook"
t.string "video"
t.string "twitter"
t.string "linkedin"
t.string "google_plus"
t.string "youtube"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "profession_id"
end
I have ran rake db:migrate and all seems fine until the page is rendered. Any clues as to why this is throwing the error would be awesome. Thanks