Sha256: 303813399353d3e55a0c1c214d68bece5665e1b027814f998792fe20fef16aac

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

require 'less'
module Grandstand
  class StylesheetsController < ApplicationController
    def show
      stylesheet = File.join(Grandstand::Application.root, 'app', 'stylesheets', "#{params[:name]}.less")
      if File.file?(stylesheet)
        engine = File.open(stylesheet) {|file| Less::Engine.new(file) }
        render :content_type => 'text/css', :text => engine.to_css
      else
        grandstand_not_found
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grandstand-0.2.7 lib/grandstand/stylesheets_controller.rb
grandstand-0.2.6 lib/grandstand/stylesheets_controller.rb