Note that there are some explanatory texts on larger screens.

plurals
  1. POActs_as_commentable: AssociationTypeMismatch
    primarykey
    data
    text
    <p>I'm using "acts_as_commentable" gem, but If i try to create a new comment to a "status" I get this error.</p> <p><img src="https://i.stack.imgur.com/vE7og.png" alt="enter image description here"></p> <p><strong>Controller</strong></p> <p><img src="https://i.stack.imgur.com/zbevP.png" alt="enter image description here"></p> <p><strong>Update:</strong></p> <p>If I use this, I don't get any errors but it doesn't save the comment into database </p> <pre><code>private def status_params params.require(:status).permit(:user, :message, :comments) end </code></pre> <p><strong>View</strong></p> <p><img src="https://i.stack.imgur.com/3rUYw.png" alt="enter image description here"></p> <pre><code>&lt;% if user_signed_in? %&gt; &lt;%=form_for([resource.user, resource]) do |f| %&gt; &lt;%=f.fields_for :comments do |fc| %&gt; &lt;div class="row"&gt; &lt;div class="large-1 columns"&gt; &lt;%=image_tag current_user.photo %&gt; &lt;/div&gt; &lt;div class="large-11 columns text-left"&gt; &lt;%=fc.text_area :comment, placeholder: "Write a comment..."%&gt; &lt;div class="text-right"&gt; &lt;%=fc.submit "Send", :class=&gt;"pure-button pure-button-xsmall pure-button-primary" %&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;% end %&gt; &lt;% end %&gt; </code></pre> <p><strong>Model</strong> (Status)</p> <pre><code>class Status &lt; ActiveRecord::Base belongs_to :user acts_as_commentable acts_as_likeable validates :message, :presence =&gt; true end </code></pre> <p><strong>Model</strong> (User) class User &lt; ActiveRecord::Base</p> <pre><code> devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :omniauthable has_many :statuses has_many :photos has_many :videos has_one :player_profile mount_uploader :photo, ProfilePhotoUploader accepts_nested_attributes_for :player_profile acts_as_liker end </code></pre> <p><strong>Gemfile</strong></p> <pre><code> source 'https://rubygems.org' ruby '2.0.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.0.0' gem 'pg' gem 'sass-rails', git: 'https://github.com/rails/sass-rails.git' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '&gt;= 1.3.0' # Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails', git: 'git://github.com/rails/coffee-rails.git' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails', '~&gt; 3.0.0' # assets gem "asset_sync" gem 'zurb-foundation', :git =&gt; "https://github.com/zurb/foundation.git" gem "compass" gem 'compass-rails', '2.0.alpha.0' gem 'bourbon' gem "font-awesome-rails" gem 'kaminari' gem 'jquery-turbolinks', github: "kossnocorp/jquery.turbolinks" gem 'turbolinks', github: "rails/turbolinks" # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~&gt; 1.0.1' group :doc do # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', require: false end #gem 'protected_attributes' gem 'devise' #, "~&gt; 3.0.0.rc", github: 'plataformatec/devise' #, branch: 'rails4' gem 'responders', github: 'plataformatec/responders' gem 'inherited_resources', github: 'josevalim/inherited_resources' gem 'ransack' gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4' gem 'formtastic', github: 'justinfrench/formtastic' gem "nested_form" gem "simple_form" gem "mini_magick" gem 'omniauth' gem 'omniauth-facebook' gem 'carrierwave' gem "fog", "~&gt; 1.3.1" gem 'public_activity' gem 'acts_as_commentable' gem "socialization" gem 'rails_12factor' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload