| Issue 127: | PATCH fix to allow route overriding | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Per the Engines documentation, the substruct/config/routes.rb file does not facilitate overriding routes. I commented out the class definition as it overrides all custom routes in your RAILS_ROOT/config/routes.rb. Also, I removed all instances of "map." as it is not necessary in the Engines route file. For more info, have a look at the engines/lib/engines/rails_extensions/routing.rb. After copying substruct/config/routes.rb to the substruct plugin root, I can now include: map.from_plugin :substruct in my RAILS_ROOT/config/routes.rb file to include default substruct routes while maintaining custom routes.
Aug 26, 2008
Project Member
#1
subim...@gmail.com
Status:
Accepted
Aug 26, 2008
Sure thing. I'll look into it.
Aug 26, 2008
Ok, I've modified the substruct.rake task to accommodate including the map.from_plugin call into RAILS_ROOT/config/routes.rb. I also commented out the line that copies the routes file to the freshly created rails project in favor of copying it to the substruct engine root path. The file needs to be located here in order for the map.from_plugin call to work properly. I've ran the package command (rake substruct:release:package VERSION=1.0.a4) to test that the routes.rb file gets modified properly and also, after untar'ing, the app runs smoothly. The map.from_plugin call is inserted as the first route. Hopefully, most people should know that the route priority is based on the order in which they appear and that if they wanted to make a route to another controller, they would put that before the map.from_plugin call.
Aug 28, 2008
Cleaned things up and moved the location of the Substruct routes file so that extra copying wouldn't be necessary. Fixed r149 |