# Stupid questions about erb

**URL:** <https://www.ruby-forum.com/t/stupid-questions-about-erb/172790>\
**Category:** Rails\
**Created:** [July 28, 2009, 2:45am UTC](https://www.ruby-forum.com/t/stupid-questions-about-erb/172790 "2009-07-28T02:45:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [July 28, 2009, 2:45am UTC](https://www.ruby-forum.com/t/stupid-questions-about-erb/172790/1 "2009-07-28T02:45:57Z")

</div>

I have been trying to find these answers in Google, but not getting any  
clarity.

I am writing in Rails 2.3.2 but have always lived in a 1.2.x world.

In the 1.2.x world, putting this in an rhtml file would always render  
properly for both screen & print…

\<%= stylesheet\_link\_tag ‘reports\_print.css’ %\>

In current erb file, screen is rendered properly but not print.

How do I designate it to use the public/stylesheets/reports\_print.css  
for both screen and print now?

Craig

–  
This message has been scanned for viruses and  
dangerous content by MailScanner, and is  
believed to be clean.

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [July 28, 2009, 3:28am UTC](https://www.ruby-forum.com/t/stupid-questions-about-erb/172790/2 "2009-07-28T03:28:06Z")

</div>

Hello Craig:

\<%= stylesheet\_link\_tag ‘reports\_print’, :media =\> :all %\>

will generate:

See examples in the documentation:

[http://railsapi.com/doc/rails-v2.3.3.1/classes/ActionView/Helpers/AssetTagHelper.html#M002343](http://railsapi.com/doc/rails-v2.3.3.1/classes/ActionView/Helpers/AssetTagHelper.html#M002343)

Cheers,  
Nicholas

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [July 28, 2009, 3:50am UTC](https://www.ruby-forum.com/t/stupid-questions-about-erb/172790/3 "2009-07-28T03:50:20Z")

</div>

On Mon, 2009-07-27 at 18:26 -0700, Nicholas H. wrote:

> [http://railsapi.com/doc/rails-v2.3.3.1/classes/ActionView/Helpers/AssetTagHelper.html#M002343](http://railsapi.com/doc/rails-v2.3.3.1/classes/ActionView/Helpers/AssetTagHelper.html#M002343)

* * *

yes, thanks. I think the commented lines were my 1.2.x style and I had  
already found that and for some strange reason, that particular report  
formatted print the same as screen. But better to make it predictable  
and follow the rules.

I think that I don’t understand the differences between erb files and  
rhtml files and before I write a bunch of view files, it would be nice  
to understand the differences. Does anyone have a link to a page that  
explains the differences between rhtml and erb?

Craig

–  
This message has been scanned for viruses and  
dangerous content by MailScanner, and is  
believed to be clean.

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [July 28, 2009, 4:01am UTC](https://www.ruby-forum.com/t/stupid-questions-about-erb/172790/4 "2009-07-28T04:01:28Z")

</div>

Hello Craig,

There’s no difference between rhtml and erb, it was a change in naming  
conventions:

“We’ve separated the format of the template from its rendering engine.  
So show.rhtml now becomes show.html.erb, which is the template that’ll  
be rendered by default for a show action that has declared format.html  
in its respond\_to. And you can now have something like show.csv.erb,  
which targets text/csv, but also uses the default ERB renderer.”

> **[Rails 2.0: It's done!](https://rubyonrails.org/2007/12/7/rails-2-0-it-s-done)**
>
> Rails 2.0 is finally finished after about a year in the making. This is a fantastic release that’s absolutely stuffed with great new features, loads of fixes, and an incredible amount of polish. We’ve even taken a fair bit of cruft out to make the...

Cheers,  
Nicholas
