質問

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