
October 16th, 2010, 11:47 PM
|
|
Registered User
|
|
Join Date: Oct 2010
Location: Toronto, Canada
Posts: 5
Time spent in forums: 1 h 11 m 7 sec
Reputation Power: 0
|
|
|
Rails: Modifying <head> to include various metas and title tags
Hello,
I've been learning Ruby these past few days and I'm really liking it. I'm still sort of confused by rails.
I'm trying to integrate a block of meta tags (along with one title tag) into the header of each one of my pages.
The tags & title for every page are different.
Based on the ERB template mechanism that's already running on this site, the path:
...WEBSITE/stable/app/views/main
contains ERB's of all my html files: index.html.erb, about.html.erb, contact.html.erb, etc.
...WEBSITE/stable/app/views/layouts, I find a file named application.html.erb containing the following:
PHP Code:
<%= yield :extra_header_tags %>
<%= stylesheet_link_tag 'jquery.lightbox-0.5' %>
<%= stylesheet_link_tag 'style.css' %>
<%= yield :stylesheets %>
<%= javascript_include_tag ['jquery', 'jquery.lightbox-0.5', 'java.js'] %> <%= yield :javascripts %>
<%= yield %>
What is this <%= yield :extra_header_tags %>?
And how do I integrate my meta's in such a way that they're different for every page?
I guess I'm supposed to define some variables and then point them to someplace but I'm not sure how, any help would be very welcome.
Thanks!
(sorry for being such a n00b)
|