문제

I'm running Rails 4 and using the gem 'acts-as-taggable' to keep track of tags on posts. All extremely simple and works as advertised locally on my machine. However on my VPS (Digital Ocean, Ubuntu 12.04) it doesn't. When saving the post it throws an error.

The behavior is quite strange, it works with lower case Icelandic letters but not with uppercase letters. I've updated the locale on both the server and of the postgres instance, nothing seems to help.

도움이 되었습니까?

해결책

Well, I don't know whether I should just delete the question but I'm leaving it here if anyone experiences the same.

Anyway, I found out what was causing the issue while trying it on the rails console. It was obvious there that 'acts-as-taggable' expects by default tags to be lowercase.

The solution however is really simple, just add this line to an initializer.

ActsAsTaggableOn.strict_case_match = true

It just goes to show that sometimes reading the fine manual is the way to go.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top