-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DashboardGenerator does not update routes #720
Comments
Is this still open for PRs? I'm new to the Rails community is it common for the routes.rb file to be in a different folder? Seems like a lot of stuff in the install generator process relies on routes.rb to be in the config folder and not just the routes generator. |
Hi @rnice01! Sure is! It might be in a different place if you're using a lot of Rails Engines and so administrate (an Engine itself) might not be able to determine where to put things. |
@nickcharlton Thanks for getting back to me, I'd love to work on something for this. After looking at the install and routes generator, it looks like both of them are looking directly at the /config directory from the Rails root for the routes.rb file. My idea for this PR is to create a generator helper method to first check where the routes.rb would be, like it is now, and if it can't find it then do a quick search through the project's directories from the Rails root for the routes.rb file. This could then be used in any generator needing to find the routes.rb file like the install and routes generators. What are your thoughts for this? |
That sounds like a good idea! I look forward to seeing it. |
thoughtbot#720 Because there may be Rails projects with the routes.rb file in a different location than Rails.root/config a helper was added to locate the file. The helper will look in the 'normal' routes.rb location and then search through the project if not located there.
thoughtbot#720 Because there may be Rails projects with the routes.rb file in a different location than Rails.root/config a helper was added to locate the file. The helper will look in the 'normal' routes.rb location and then search through the project if not located there.
thoughtbot#720 Because there may be Rails projects with the routes.rb file in a different location than Rails.root/config a helper was added to locate the file. The helper will look in the 'normal' routes.rb location and then search through the project if not located there.
thoughtbot#720 Because there may be Rails projects with the routes.rb file in a different location than Rails.root/config a helper was added to locate the file. The helper will look in the 'normal' routes.rb location and then search through the project if not located there.
Because there may be Rails projects with the routes.rb file in a different location than Rails.root/config a helper was added to locate the file. The helper will look in the 'normal' routes.rb location and then search through the project if not located there. Fixes thoughtbot#720
Because there may be Rails projects with the routes.rb file in a different location than Rails.root/config a helper was added to locate the file. The helper will look in the 'normal' routes.rb location and then search through the project if not located there. Fixes thoughtbot#720
I'm going to close this one as there hasn't been any activity in a long time. |
Apologies if someone else has already submitted this.
If you use
rails g administrate:dashboard
to create a new dashboard file, the new dashboard is not added toconfig/routes.rb
, and thus it does not appear automatically in the sidebar. I realize this is probably on purpose; after all, how is the generator going to know where in the routes file it needs to add a new line, especially if you've rearranged things? If that's the case, then I feel like the generator needs to display some kind of instructions when you run it to inform the user that they need to do this manually. For instance, if you ranrails g administrate:dashboard Foo
, you would see something like:The text was updated successfully, but these errors were encountered: