hi! I want to have different titles in my weblog. in my app/views/layout/post.html.erb i have this in head: <title><%= controller.action_name %> :: webstic blog :)</title> thats fine if im in page that listing my blog articles! but if i chooce to view a page i want the title.post in my <title> how i can do that? thanks philip.g -- Posted via ruby-forum.com.
Philip Gavrilos wrote:> > hi! > > I want to have different titles in my weblog. > > in my app/views/layout/post.html.erb > > i have this in head: <title><%= controller.action_name %> :: webstic > blog :)</title> > > thats fine if im in page that listing my blog articles! > > but if i chooce to view a page i want the title.post in my <title> > > how i can do that? > > thanks > > philip.gi found it! sorry for the rush post! i could help im writing what i''ve did: in my app/views/layout/posts.html.erb <title><%= yield :title %>:: my fisrt rails blog :)</title> in my app/views/posts/index.html.erb <% content_for :title do %> <%= controller.action_name %> <% end %> and my _post partial <% content_for :title do %> <%= post.title %> <% end %> this works for me :) -- Posted via ruby-forum.com.
On Aug 12, 2009, at 4:06 PM, Philip Gavrilos wrote:> CUTThere''s even a better solution, search the API for content_for. ngw
Nicholas Wieland wrote:> On Aug 12, 2009, at 4:06 PM, Philip Gavrilos wrote: > >> CUT > > There''s even a better solution, search the API for content_for. > > ngwUm, isn''t that what he used? Best, -- Marnen Laibow-Koser marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via ruby-forum.com.
Hi there, Taking this a little step further, this is the pattern that our team has been using. robbyonrails.com/articles/2008/03/26/managing-seo-friendly-html-titles-with-rails Good luck! Robby On Wed, Aug 12, 2009 at 7:06 AM, Philip Gavrilos<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Philip Gavrilos wrote: >> >> hi! >> >> I want to have different titles in my weblog. >> >> in my app/views/layout/post.html.erb >> >> i have this in head: <title><%= controller.action_name %> :: webstic >> blog :)</title> >> >> thats fine if im in page that listing my blog articles! >> >> but if i chooce to view a page i want the title.post in my <title> >> >> how i can do that? >> >> thanks >> >> philip.g > > > i found it! sorry for the rush post! > > i could help im writing what i''ve did: > > > in my app/views/layout/posts.html.erb > > <title><%= yield :title %>:: my fisrt rails blog :)</title> > > > in my app/views/posts/index.html.erb > > <% content_for :title do %> > <%= controller.action_name %> > <% end %> > > and my _post partial > > <% content_for :title do %> > <%= post.title %> > <% end %> > > > this works for me :) > > -- > Posted via ruby-forum.com. > > > >-- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails planetargon.com robbyonrails.com twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax]
On Aug 14, 2009, at 3:03 AM, Marnen Laibow-Koser wrote:> > Nicholas Wieland wrote: >> On Aug 12, 2009, at 4:06 PM, Philip Gavrilos wrote: >> >>> CUT >> >> There''s even a better solution, search the API for content_for. >> > > Um, isn''t that what he used?I need to put more attention when I read :) My bad. ngw --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---