bernat/best_in_place — Issue #37: Use 'model_name' method to get class name
Author: RKushnir
Created: 2011-11-15 14:42:36+00:00
State: open

Currently you have in `helper.rb`:

data-object='#{object.class.to_s.gsub("::", "_").underscore}'

While it's not possible to override `class` for the object, `ActiveRecord` and `ActiveResource` have a `model_name` method which gives an opportunity to override how the object will be named in forms. Consider using this method when it's possible please, like:

name = object.class.respond_to?(:model_name) ?
object.class.model_name : object.class.name.gsub("::", "_").underscore