We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was receiving this error, with a fresh install of 2.2.2 on rails 4.1.5:
ActionController::UnpermittedParameters - found unpermitted parameters: commentable_type, commentable_id: actionpack (4.1.5) lib/action_controller/metal/strong_parameters.rb:377:in `unpermitted_parameters!' actionpack (4.1.5) lib/action_controller/metal/strong_parameters.rb:270:in `permit' the_comments (2.2.2) app/controllers/concerns/controller.rb:168:in `comment_params' the_comments (2.2.2) app/controllers/concerns/controller.rb:113:in `create'
I was able to easily fix by adding this to my own comments_controller:
def comment_params params .require(:comment) .permit(:title, :contacts, :raw_content, :parent_id, :commentable_type, :commentable_id) .merge(denormalized_fields) .merge(request_data_for_comment) .merge(tolerance_time: params[:tolerance_time].to_i) .merge(user: current_user, view_token: comments_view_token) end
..but I don't understand how it ever could have worked by default. Is this a bug, or is something wrong with my installation?
The text was updated successfully, but these errors were encountered:
Hello! You should to remove additional params here. Because :commentable_type, :commentable_id used into another place:
:commentable_type, :commentable_id
https://github.com/the-teacher/the_comments/blob/master/app/controllers/concerns/the_comments/controller.rb#L138
Right now I can't understend why you have this error. Try to install code from master version 2.3.0 For my projects gem works fine.
master
2.3.0
Btw, I worrking on version 3. You can learn new version in branch v3.0
v3.0
Sorry, something went wrong.
In the view, have you edited @post
<%= render partial: 'the_comments/tree', locals: { commentable: @post, comments_tree: @comments } %>
?
btw: secret project: https://github.com/TheComments
out of date. sorry
No branches or pull requests
I was receiving this error, with a fresh install of 2.2.2 on rails 4.1.5:
I was able to easily fix by adding this to my own comments_controller:
..but I don't understand how it ever could have worked by default. Is this a bug, or is something wrong with my installation?
The text was updated successfully, but these errors were encountered: