accessing Ruby variable(from model or controller) in SASS

Posted by corroded on Stack Overflow See other posts from Stack Overflow or by corroded
Published on 2010-06-03T09:00:31Z Indexed on 2010/06/03 9:04 UTC
Read the original article Hit count: 223

Filed under:
|
|
|

Is there a way to access ruby variables in sass or do i have to make a custom function for it?

What im trying to do is to generate a stylesheet for each user so in the controller, i do something like:

def show
  respond_to do |format|
    format.css{render :partial => "styles"}
  end
end

then in the view name _styles.haml i do this:

:sass
  #header
    :background url(user.banner.url)

is this possible at all?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby