-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix errors when setting custom namespace #80
Conversation
@andrewculver As I'm sifting through this one, I feel like there's a lot of moving parts and I want to make sure I'm headed in the right direction. In other words, I guess I don't have a clear goal in sight as to how these namespaced files need to be set up, and I don't want to start building too much in the wrong direction. Controller placementFor example, one thing that stands out is the directory hierarchy for the normal child controller. It is namespaced under However the API controller is here, not under I'm guessing that we need to create the Routes filesWhen setting
Other filesI think I'll wait until we have a clear direction on this part, because I don't want to take up too much time if it's not what we need. As far as my analysis of the issue goes though, it seems like these are the main things we need to take care of. |
With this last commit, I made sure we're including the custom namespaced routes file ( Now that I'm looking over the code, it seems like everything isn't set in place yet (for example, I could see us doing the following things next:
I'll leave things as is for now since I'm noticing some other TODOs in the Transformer that I overlooked before. |
@gazayas Can you resolve the conflicts on this one? |
Closing in favor of bullet-train-co/bullet_train-core#35 |
Concerning issue 428 in the starter repo
Now that we have multiple routes files, I used
routes_path
to make sure we're writing to the correct files.Concerning #78
bullet_train-super_scaffolding/lib/scaffolding/transformer.rb
Lines 1269 to 1273 in 9a01b0d
We have
skip-api
set totrue
here, so we can generate the missing API controller in #78 by removing this line. I'm assuming that's what we'll want to do since we're already generating the API views when super scaffolding. Things have changed a lot since we stopped using Grape, so I can see us removing the flag here.Concerning the missing show page, here's the block that tries to add a child to the parent's show page:
bullet_train-super_scaffolding/lib/scaffolding/transformer.rb
Lines 1343 to 1351 in 9a01b0d
In #78's case, the child is
Job
. However, the string is getting transformed in such a way that the parentTeam
is getting namespaced under the custom namespaceclient
:'./app/views/client/teams/show.html.erb'
Since the namespace
client
doesn't have its own set of views, do we need to add a list of the children to theTeam
show page, or can we just skip this part? I'm guessing that we should add it, so I'll try to set this PR as ready for review once I get that set up.Tests
I don't think we have any tests in place for the namespace option, so I'll keep that on my radar as I work through this one.