Dynamic CSS stylesheets in Rails
1 class StylesheetsController < ApplicationController 2 layout nil 3 session :off 4 def rcss 5 if rcss = params[:rcss] 6 file_base = rcss.gsub(/.css$/i, '') 7 file_path = "#{RAILS_ROOT}/app/views/stylesheets/#{file_base}.rcss" 8 @color = '#f77' # example setting 9 render(:file => file_path, :content_type => "text/css") 10 else 11 render(:nothing => true, :status => 404) 12 end 13 end 14 end