Templates

Many of you might probably be familiar with the WordPress template
model… Is there a way to have something like that working in RoR? I
mean, importing an html file into a Ruby application…

Also, always referring to the WP model, is there a way to discover what
page you’re browsing? Ie. if it’s an article page, or an archive, or a
static page… so that, for example, the sidebar or the footer change
accordingly?

Thanks!