diff --git a/lib/roar/rails/formats.rb b/lib/roar/rails/formats.rb index bfd08a4..b8b3401 100644 --- a/lib/roar/rails/formats.rb +++ b/lib/roar/rails/formats.rb @@ -42,7 +42,7 @@ def collection_representer(format, model, controller_path) end def entity_representer(format, model, controller_path) - model_name = model.class.name.underscore + model_name = model.model_name.name.underscore if namespace = controller_path.namespace model_name = "#{namespace}/#{model_name}" @@ -71,4 +71,4 @@ def namespace end end end -end \ No newline at end of file +end