Here’s a little trick I used to get the classify string method to work right. I was having a problem that just using classify was turning e.g. “stock_status” into “StockStatu”, which is obviously incorrect, even though I had the correct line in “config/initializers/inflection.rb”. The simple fix was to pluralize the string first, e.g. “stock_status”.pluralize.classify returns the correct “StockStatus”.
Other Posts That Might Interest You




