[Rails] Re: A way to build </span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=rubyonrails-talk@googlegroups.com&q=from:%22Thomas+Allen%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Thomas Allen</span></span></a></span> <span class="date"><a href="/search?l=rubyonrails-talk@googlegroups.com&q=date:20100421" rel="nofollow">Wed, 21 Apr 2010 08:12:31 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre>Thanks, that seems to be the right idea. Here's what I ultimately settled on...the following results in "Home | Dashboard | PNC" for a request to DashboardController#index.</pre><pre> class ApplicationController < ActionController::Base def self.title item before_filter do |controller| controller.instance_eval do title item end end end title :pnc def initialize @title_parts = [] super end protected def title item @title_parts.insert 0, item end end module ApplicationHelper def title @title_parts.map { |part| t part }.join ' | ' end end class DashboardController < ApplicationController title :dashboard def index title :home end end <title><%= title %></title> Thomas On Apr 21, 3:38 am, Alexandre Friquet <a...@infopiiaf.fr> wrote: > Hi Thomas, > > > How might I clean this up? My ideal would be for each controller to be > > able to call "title" setting its part of the title, and for individual > > actions to manually prepend their title part: > > You may have a look to this screencast from Ryan Bates > :<a rel="nofollow" href="http://railscasts.com/episodes/30-pretty-page-title">http://railscasts.com/episodes/30-pretty-page-title</a> > > Pretty clean and efficient! > > Hope it helps ;) > > @lex > >  smime.p7s > 2KViewDownload -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at <a rel="nofollow" href="http://groups.google.com/group/rubyonrails-talk?hl=en">http://groups.google.com/group/rubyonrails-talk?hl=en</a>. </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg59125.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="index.html#59179">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="maillist.html#59179">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg59074.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email"><span class="subject"><a href="msg59073.html">[Rails] A way to build <title></a></span> <span class="sender italic">Thomas Allen</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg59125.html">Re: [Rails] A way to build <title></a></span> <span class="sender italic">Alexandre Friquet</span></li> <li><ul> <li class="icons-email tSliceCur"><span class="subject">[Rails] Re: A way to build <title></span> <span class="sender italic">Thomas Allen</span></li> </ul> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="[Rails] Re: A way to build <title>"> <input type="hidden" name="msgid" value="8c9c3866-22fb-4c77-864d-a317a58c102d@e21g2000vbb.googlegroups.com"> <input type="hidden" name="relpath" value="rubyonrails-talk@googlegroups.com/msg59179.html"> <input type="submit" value=" Thomas Allen "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="rubyonrails-talk@googlegroups.com"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search rubyonrails-talk"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/rubyonrails-talk@googlegroups.com/">rubyonrails-talk - all messages</a></li> <li class="icons-about"><a href="/rubyonrails-talk@googlegroups.com/info.html">rubyonrails-talk - about the list</a></li> <li class="icons-expand"><a href="/search?l=rubyonrails-talk@googlegroups.com&q=subject:%22%5C%5BRails%5C%5D+Re%5C%3A+A+way+to+build+%3Ctitle%3E%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg59125.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg59074.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> <a href="#"><img src="/rubyonrails-talk@googlegroups.com/logo.png" alt="rubyonrails-talk"></a> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">8c9c3866-22fb-4c77-864d-a317a58c102d@e21g2000vbb.googlegroups.com</li> </ul> </div> </body> </html>