Open 127 opened 11 years ago
+1
See my answer on StackOverflow to a similar question. Basically, just don't whitelist :tag_list
and tag the object manually. So your create
actions will look like this:
def create
@photo = Photo.new(photo_params) # at this point @photo will not have any tags, because :tag_list is not whitelisted
current_user.tag(@photo, on: :tags, with: params[:photo][:tag_list])
if @photo.save
redirect_to @photo
else
render :new
end
end
and this will not create double taggings.
This case fails to add tagger_id and tagger_type
So, it looks like a bug. This case would work but will set dupes with tagger_id or tagger_type equal NULL .
The solution is quite lame 1) Fixed form to accept raw params
2) Fixed controller (update for example)
Is there any simple way to use this gem with devise?