does the routes.rb have some kind of automatic generated url_for a '''' map.connect? (say, something like url_for_homepage or homepage_url) ...i''ve looked around, tried a couple of combos but nothing really worked. do i have the wrong lead? ? thanks... -- Posted via http://www.ruby-forum.com/.
On 7/2/06, jeff <jeff@jeffie.com> wrote:> > does the routes.rb have some kind of automatic generated url_for a '''' > map.connect? > (say, something like url_for_homepage or homepage_url) ...i''ve looked > around, tried a couple of combos but nothing really worked. do i have > the wrong lead? > > ? > > thanks...At the end of your routes map use something like map.connect ''/'', :controller => ''default_controller'', :action => ''default_action'' but be sure to remove the index.html from your public directory. If that is in there it will be served instead of any action specified in the routes. --> Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060702/c0d5171c/attachment-0001.html
...i was actually hoping to see if there was some kind of automatic method (for all of my views?) that is generated when i do the action you''ve specified (ie, map.connect '''' , :controller =>...) i happen to know there is a actionname_url method or something similar that is generated when you map.connect some actionname, and i was wondering if there was a convention for a '''' map.connect...if not, then not, although i am pretty sure i saw some posting on wiki.rubyonrails.com, but then again, after looking through it a second time today, and not finding it, i''m not really sure anymore. ? -- Posted via http://www.ruby-forum.com/.
jeff wrote:> ...i was actually hoping to see if there was some kind of automatic > method (for all of my views?) that is generated when i do the action > you''ve specified (ie, map.connect '''' , :controller =>...) > i happen to know there is a actionname_url method or something similar > that is generated when you map.connect some actionname, and i was > wondering if there was a convention for a '''' map.connect...if not, then > not, although i am pretty sure i saw some posting on > wiki.rubyonrails.com, but then again, after looking through it a second > time today, and not finding it, i''m not really sure anymore. > > ? > >Used named routes and you can explicitly set what you want it to be called. IE: map.homepage ... instead of: map.connect ... Then homepage_url will work. hth -- R.Livsey http://livsey.org