P
P
pup_pupets2016-07-08 00:45:55
Ruby on Rails
pup_pupets, 2016-07-08 00:45:55

Acts_as_taggable_on doesn't save tags with different case, why?

When saving a post, I get the error "There were errors: Tag cannot be empty." Empirically, it was established that the problem is due to the fact that the tags are in different registers in Russian. Those. You cannot save "Vasya and Petya" after "Vasya and Petya". It turned out that the problem is in postgresql (more precisely, in the lower function) and in the downcase method, which is used by Acts_as_taggable_on. lower will omit all words, and downcase for Russian characters will work only for the first word, but not for the rest. On the forums, it is advised to write in initialization:

class String
  def downcase
    self.mb_chars.downcase.to_s
  end
end

... but it did not help. Tell me, did anyone come across and how did you solve it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question