Different titles

hi!

I want to have different titles in my weblog.

in my app/views/layout/post.html.erb

i have this in head: <%= controller.action_name %> :: webstic
blog :slight_smile:

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

how i can do that?

thanks

philip.g

Philip G. wrote:

hi!

I want to have different titles in my weblog.

in my app/views/layout/post.html.erb

i have this in head: <%= controller.action_name %> :: webstic
blog :slight_smile:

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

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

<%= yield :title %>:: my fisrt rails blog :)

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 :slight_smile:

On Aug 12, 2009, at 4:06 PM, Philip G. wrote:

CUT

There’s even a better solution, search the API for content_for.

ngw

Nicholas W. wrote:

On Aug 12, 2009, at 4:06 PM, Philip G. wrote:

CUT

There’s even a better solution, search the API for content_for.

ngw

Um, isn’t that what he used?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Hi there,

Taking this a little step further, this is the pattern that our team
has been using.

http://www.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[email protected] wrote:

blog :slight_smile:

<% end %>

this works for me :slight_smile:

–
Posted via http://www.ruby-forum.com/.

–
Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting w/Ruby on Rails

http://robbyonrails.com/
http://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 W. wrote:

On Aug 12, 2009, at 4:06 PM, Philip G. 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 :slight_smile:
My bad.

ngw