如何解决此错误:
SQLite3::SQLException: 没有这样的列:functionalities.profile_id: SELECT "functionalities".* FROM "functionalities" WHERE "functionalities"."profile_id" = 1
这是我的 _form.html.erb
<h3>Add functionalities</h3>
<% if current_user.admin? %>
<%= f.collection_check_boxes :functionality_ids, Functionality.all, :id, :description %>
<% else %>
<%= f.collection_check_boxes :functionality_ids, Functionality.where(profile_id: current_user.profile.id), :id, :description %>
<% end %>
简介.rb
has_many :users
has_many :profile_functionalities
has_many :functionalities, through: :profile_functionalities
belongs_to :manager
belongs_to :agent
功能性.rb
# Nothing here for now
ProfileFunctionality.rb
belongs_to :profile
belongs_to :functionality
我认为我需要加入,因为当我在else时出现错误。