I have a series of 'static' pages for a site that need named routes in
Rails 3. I'm trying to DRY the routes file, but can't seem to find the
proper code.
The desired output/code is:
match '/about' => 'info#about', :as => :about
for each page. My attempt to dry this:
%w(about services articles marketing clients).each do |page|
match eval( "'/#{page}' => 'info##{page}', :as => :#{page}")
end
Any suggestions?
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.