Skip to content
New issue

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

Rails 5.2 compatibility? #874

Closed
rgbskills opened this issue Dec 15, 2017 · 5 comments
Closed

Rails 5.2 compatibility? #874

rgbskills opened this issue Dec 15, 2017 · 5 comments
Milestone

Comments

@rgbskills
Copy link

Hey guys I am trying to make this work in rails 5.2 but I am having trouble.

screen shot 2017-12-15 at 15 35 11

@jkburges
Copy link

See: #872

@rgbskills
Copy link
Author

I am removing Acts as taggable from my project and using something else, I think I will give "gutentag" gem a try. :(

@kobaltz
Copy link

kobaltz commented Feb 15, 2018

@rgbskills I feel the same way. However, on a Rails 5.2 app, I was able to get around this with a private method in the controller just to get things working again temporarily.

It basically gets the list of removed tags and removes them from the model. It then gets the new tags and adds them to the model. I ran into similar issues with the []= error and the other reported ones. This seems to get around the problem without having to change any other code. For existing applications, this may be a better workaround than migrating to a different solution.

  def set_tags
    new_tags = model_strong_params['tag_list'].to_a.reject { |c| c.empty? }
    old_tags = @model.tags.map(&:name)
    return if new_tags == old_tags
    (old_tags - new_tags).map {|e| @model.tag_list.remove(e)}
    (new_tags - old_tags ).map {|e| @model.tag_list.add e}
  end

@noma4i
Copy link

noma4i commented May 29, 2018

I have merged all knowing fixes into one fork. Feel free to use/fork it https://github.com/noma4i/acts-as-taggable-on

@glendel
Copy link

glendel commented May 31, 2018

Please go to here : Pull Request #887 to see all the ready to merge and to use solutions to work with Rails 5.2! It is fully tested and ready to go! It is just missing to merge the changes into the main project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants