My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 127: PATCH fix to allow route overriding
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Aug 2008


 
Reported by wes...@gmail.com, Aug 26, 2008
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.
 
routes_fix_to_allow_overriding.diff
2.0 KB   View   Download
Aug 26, 2008
Project Member #1 subim...@gmail.com
Interesting, thank you.

Can you look at / modify the substruct.rake file to account for your new changes, and
how this should be handled when packaging a release? Relevant line is #216. Currently
we're advising copying the routes.rb file into the config directory. Looks like this
should be included with your map.from_plugin call.

If you can provide a patch that addresses that I'll roll it in ASAP.
Status: Accepted
Aug 26, 2008
#2 wes...@gmail.com
Sure thing. I'll look into it.
Aug 26, 2008
#3 wes...@gmail.com
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.
insert_default_substruct_routes.diff
1.4 KB   View   Download
Aug 28, 2008
Project Member #5 subim...@gmail.com
Cleaned things up and moved the location of the Substruct routes file so that extra
copying wouldn't be necessary.

Fixed r149

Powered by Google Project Hosting