This is a heck of a lot easier to do in the presentation than the style.
Consider this:
body
.red
background-color: red
.green
background-color: green
<body class="<%= @theme_main_color %>">
Stuff inside
</div>
In your controller (or application controller), simply set @theme_main_color to
whatever you want.
On Sep 13, 2011, at 7:56 AM, Rafa Colom wrote:
> I''m trying change the value of a scss variable dynamically using
rails
> 3.1.
>
> For example:
>
> In a example.css.scss
>
> $main-color: red;
> body {
> background-color: $main-color;
> color: #333;
> font-family: verdana, arial, helvetica, sans-serif;
> font-size: 13px;
> line-height: 18px; }
>
>
> And in the model user, I put the field color_prefered. And I want to
> change the value of a $main-color with the value of user.color_prefered.
>
> Is it possible?
>
> Tk.
> Rafa.
>
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.