Sha256: a390e5bd5c3ae03d2c6290c8128c3b6a8b07e9243210f5b1066adcdfafdf16e4

Contents?: true

Size: 742 Bytes

Versions: 1

Compression:

Stored size: 742 Bytes

Contents

module Kayessess

  # The ApplicationController is the class which all Kayessess rails controllers inherit from.
  class ApplicationController < ActionController::Base
    skip_before_filter :login_required
    before_filter :parse_styles

    # So dirty.
    # This little hack allows styleguide examples to use path helpers and other
    # fun stuff from the main app.
    def method_missing(name, *args)
      main_app.send(name, *args)
    end

  private

    def parse_styles
      require 'kss'

      parser = Kss::Parser.new(File.join(Rails.root, '/app/assets/stylesheets'))
      @styleguide = Kayessess::Styleguide.new(parser)
    end

    def not_found
      raise ActionController::RoutingError.new('Not Found')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kayessess-0.1.5 app/controllers/kayessess/application_controller.rb