I''m working on a new app and i can''t get print.css to work properly. I can''t work out why. I''ve tried referencing it with the rails stylesheet_link_tag helper and by hard-coding the link. Neither work - when i go to print-preview (in firefox) it''s not using the right styling. The file, print.css, is in public/stylesheets. I''ve tried this: <%= stylesheet_link_tag "print", :media => "print" %> which generates: <link href="/stylesheets/print.css?1242817476" media="print" rel="stylesheet" type="text/css" /> and i''ve tried this: <link href="/stylesheets/print.css" rel="stylesheet" type="text/css" media="print" /> which of course just stays as it is. Neither work. is there something special i have to do with print stylesheets in rails? thanks max -- Posted via http://www.ruby-forum.com/.
I have <%= stylesheet_link_tag ''print'', :media => :print %> which seems to generate the same link as you have and it works fine in FF 3.0.10 Have you tried temporarily removing your standard stylesheet and replacing it with a renamed version of print.css to make sure it is not a problem with the contents? Colin 2009/5/20 Max Williams <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>> > I''m working on a new app and i can''t get print.css to work properly. I > can''t work out why. I''ve tried referencing it with the rails > stylesheet_link_tag helper and by hard-coding the link. Neither work - > when i go to print-preview (in firefox) it''s not using the right > styling. > > The file, print.css, is in public/stylesheets. I''ve tried this: > > <%= stylesheet_link_tag "print", :media => "print" %> > > which generates: > > <link href="/stylesheets/print.css?1242817476" media="print" > rel="stylesheet" type="text/css" /> > > and i''ve tried this: > > <link href="/stylesheets/print.css" rel="stylesheet" type="text/css" > media="print" /> > > which of course just stays as it is. Neither work. is there something > special i have to do with print stylesheets in rails? > > thanks > max > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, colin, i figured it out. The problem was that the main stylesheet, style.css was also being used for printing, so i needed to change the link for the main stylesheet to have media="screen, print". So, it was nothing to do with the link to print.css at all. So, now my links look like this: <%= stylesheet_link_tag "style", "incomplete", :media => "screen, print" %> <%= stylesheet_link_tag "print", :media => "print" %> and it''s all good. cheers max -- Posted via http://www.ruby-forum.com/.