Is it possible to override the routing of a controller whos name is based on a table with an underscore? For instance, I have a table named press_releases. When I generated scaffolding like this: ruby script/generate scaffold PressRelease ''admin/press_releases'' I have to access the controller as admin/press_releases but I actually want to access it as admin/pressreleases. Is there a different way to generate the scaffolding so that I can reach my controller differently? Kyle Heon kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org
I should also say that I''ve tried this: ruby script/generate scaffold PressRelease ''admin/pressreleases'' The problem with that is the controller is named Pressrelease. Minor casing issue there and I''m curious to know if I''m doing something wrong. Kyle Heon kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Kyle Heon Sent: Monday, July 18, 2005 9:03 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] Forcing controller naming Is it possible to override the routing of a controller whos name is based on a table with an underscore? For instance, I have a table named press_releases. When I generated scaffolding like this: ruby script/generate scaffold PressRelease ''admin/press_releases'' I have to access the controller as admin/press_releases but I actually want to access it as admin/pressreleases. Is there a different way to generate the scaffolding so that I can reach my controller differently? Kyle Heon kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
You can set up the config/routes.rb with a line like: map.connect ''pressreleases'', :controller=>''press_releases'', :action=>''index'' or something like that. --bryce On 7/18/05, Kyle Heon <kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:> I should also say that I''ve tried this: > > ruby script/generate scaffold PressRelease ''admin/pressreleases'' > > The problem with that is the controller is named Pressrelease. Minor casing > issue there and I''m curious to know if I''m doing something wrong. > > Kyle Heon > kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org > > > -----Original Message----- > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Kyle Heon > Sent: Monday, July 18, 2005 9:03 PM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails] Forcing controller naming > > Is it possible to override the routing of a controller whos name is based on > a table with an underscore? > > For instance, I have a table named press_releases. > > When I generated scaffolding like this: > > ruby script/generate scaffold PressRelease ''admin/press_releases'' > > I have to access the controller as admin/press_releases but I actually want > to access it as admin/pressreleases. > > Is there a different way to generate the scaffolding so that I can reach my > controller differently? > > Kyle Heon > kheon-Wuw85uim5zDR7s880joybQ@public.gmane.org > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >