-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scaffold generator: Invalid path when using --model-name=Record #919
Labels
Comments
Alexander-Senko
added a commit
to Alexander-Senko/draper
that referenced
this issue
Aug 31, 2024
Decorator will respect `--model-name` passed to `scaffold_controller` or `controller` generator. That could be of a particular use to solve namespace issues (e.g. when controllers are namespaced and models are not). The specs have been refactored to reduce and DRY the code. Resolves drapergem#919.
1 task
1 task
1 task
1 task
1 task
Alexander-Senko
added
bug
pull request attached
reproduced
and removed
pull request attached
labels
Aug 31, 2024
Alexander-Senko
added a commit
to Alexander-Senko/draper
that referenced
this issue
Sep 2, 2024
Decorator will respect `--model-name` passed to `scaffold_controller` or `controller` generator. That could be of a particular use to solve namespace issues (e.g. when controllers are namespaced and models are not). The specs have been refactored to reduce and DRY the code. Resolves drapergem#919.
Alexander-Senko
added a commit
to Alexander-Senko/magic-presenter
that referenced
this issue
Nov 18, 2024
Presenters should respect `--model-name` passed to `scaffold_controller` generator or any other one supporting this option. That could be of a particular use to solve namespace issues (e.g., when controllers are namespaced and models are not). See also drapergem/draper#919.
Alexander-Senko
added a commit
to Alexander-Senko/magic-presenter
that referenced
this issue
Nov 19, 2024
Presenters should respect `--model-name` passed to `scaffold_controller` generator or any other one supporting this option. That could be of a particular use to solve namespace issues (e.g., when controllers are namespaced and models are not). See also drapergem/draper#919.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm working on a project where Controllers and routes are namespaced but models are not.
This is how my scaffold are generated:
When specifying --model-name=Client, it would be great if the decorator wasn't namespaced and also not in a namespace folder, just like the model.
An easy fix would be editing this file: https://github.com/drapergem/draper/blob/master/lib/generators/rails/decorator_generator.rb
and changing
to
and changing
https://github.com/drapergem/draper/blob/master/lib/generators/rails/templates/decorator.rb
To not include ModuleName::ModelNameDecorator: class_name.split("::").last
The text was updated successfully, but these errors were encountered: