On Fri, Aug 31, 2007 at 01:46:15PM +0200, Andreas Roedl wrote:
> Hallo,
>
> On 8/31/07, Sebastian Wenzlaff <[EMAIL PROTECTED]> wrote:
> > Also bleiben 2 Fragen:
> > 1) Wie macht ihr das mit euren Menüs? Ihr werdet doch kaum alle
> > Einträge per HTML ins Layout schieben, oder?
>
> Bei CueSpace mache ich es wie das Blog-CMS Typo. Schau Dir dessen Code
> an. Im Application-Helper habe ich sowas:
>
> def tab(label, options = {})
> if controller.controller_name =~ /#{options[:controller].split('/').last}/
> content_tag(:li, link_to(label, options), {"class"=> "selected"})
> else
> content_tag(:li, link_to(label, options))
> end
> end
>
> Das Navigation-Partial sieht etwa so aus:
>
> <ul>
> <%= tab "Home".t, :controller => 'home', :action => 'index' -%>
> <%= tab "Search".t, :controller => 'search', :action => 'index' -%>
> ...
> </ul>
so ähnlich mache ich das auch im allgemeinen. Navigation gehört imho in
die View. Ich sehe nicht viel Sinn darin sie woanders hin auszulagern,
zumindest nicht bei 'normalen' Anwendungen mit halbwegs statischer Navi.
Jens
--
Jens Krämer
http://www.jkraemer.net/ - Blog
http://www.omdb.org/ - The new free film database
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug