Commit 31a98a9e by liyijie

Fix default resource name with model_name element

parent 895fb8b7
...@@ -134,11 +134,11 @@ class SimpleControllerGenerator < Rails::Generators::NamedBase ...@@ -134,11 +134,11 @@ class SimpleControllerGenerator < Rails::Generators::NamedBase
end end
def resource_plural def resource_plural
options.resource&.pluralize || resource_class&.model_name&.plural options.resource&.pluralize || resource_class&.model_name&.element&.pluralize
end end
def resource_singular def resource_singular
options.resource&.singularize || resource_class&.model_name&.singular options.resource&.singularize || resource_class&.model_name&.element&.singularize
end end
def resource_collection def resource_collection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment