[Rails] Re: html sitemap

2009-05-12 Thread Freddy Andersen

Creating a sitemap xml or html is just as easy as any other page...

In the controller pull the resources that are dynamic like

@pages = Pages.all

and then in the view do

% @pages.each do |page| %
%= link_to page.name, page_path(page) %
%end%

and then add the static stuff

% %w( page1 page2 ).each do |page| %
%= link_to page.name, some_path(page) %
%end%

how are your pages stored that you want in the site map?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: html sitemap

2009-05-12 Thread Phlip

Freddy Andersen wrote:
 Creating a sitemap xml or html is just as easy as any other page...

Furtherless, I would not rip the routes.rb map to generate it, because such 
routes are either boring and static, like /app/faq, or are dynamically 
generated, like /blog/post/:name, and it's the interesting ones we need in the 
nav bar or site map. I would be interested to see if anyone can think of a 
clever way to do that by ripping the routes.rb map!

-- 
   Phlip
   http://flea.sourceforge.net/resume.html


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---