stupid questions about erb

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' %>   <!-- <link href="stylesheets/reports_print.css" rel="stylesheet"     type="text/css" media="all" />-->   <style type="text/css" media="print"><!--     --></style>

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

Hello Craig:

<%= stylesheet_link_tag 'reports_print', :media => :all %>

will generate:

<link href="/stylesheets/reports_print.css" media="all" rel="stylesheet" type="text/css" />

See examples in the documentation:

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

Cheers, Nicholas

Hello Craig:

<%= stylesheet_link_tag 'reports_print', :media => :all %>

will generate:

<link href="/stylesheets/reports_print.css" media="all" rel="stylesheet" type="text/css" />

See examples in the documentation:

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

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."

Cheers, Nicholas