How yours put an variable of database in header.erb and include the header.erb file in the template?
Start by working right through a good tutorial such as railstutorial.org (which is free to use online). That will show you the basics of rails.
Colin