Rails 4 protected attributes #389

Closed
MikeSilvis opened this Issue Aug 7, 2013 · 7 comments

Projects

None yet

6 participants

@MikeSilvis

When upgrading to rails 4 and trying to modify tags via the tag_list method i get the following:

WARNING: Can't mass-assign protected attributes for ActsAsTaggableOn::Tagging: tag_id, context, taggable
@codyrobbins

+1

@kevin1024

👍

@MikeSilvis

I got rid of the protected attributes gem and it worked fine.

@fuzzyalej

I monkeypatched ActsAsTaggableOn::Tag and ActsAsTaggableOn::Tagging so they are attr_accessibles

@MikeSilvis

You want to include a gist of the work you did? Would probably also be useful to submit a PR with it.

@fuzzyalej

$ cat config/initializers/acts_as_taggable_on_patch.rb

module ActsAsTaggableOn
  class Tag
    attr_accessible :name
  end

  class Tagging
    attr_accessible :tag_id, :context, :taggable
  end
end
@seuros seuros closed this Jan 30, 2014
@gmcnaughton
Contributor

Starting with acts-as-taggable-on 4.0.0, Tagging needs :tag on the list of attributes to make accessible as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment