I found some previous questions related to this, but I'm still unable to solve my problem.
I have a prediction page. Every different tartot spread demands different CSS. I tried this:
First line of the view:
<%= stylesheet_link_tag @css_to_use %>
In the controller:
def prediction
# some other variable management
@css_to_use = @spread.css_to_use
end
So when I hit the form on the index page to process, it comes to this prediction action. I grab the data and generate the view. And this appears:
<div id="container">
<div id="content">
<link href="/stylesheets/kelta_kereszt.css?1311757386" media="screen" rel="stylesheet" type="text/css" />
<div id="kirakas_doboz">
...
So the stylesheet is included in the body tag. What do I miss?
@css_to_usein the view?<%= @css_to_use %>. I thought the problem was a different one, never mind!