Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 27 lines (21 sloc) 0.635 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
module Flutie

  class StyleguidesController < ApplicationController

    unloadable

    def show
      @styleguides = styleguides
      render :layout => "flutie" if params[:flutie] == "true"
    end

    private

    def styleguides
      all_styleguide_partials = ActionController::Base.view_paths.map do |view_path|
        styleguide_path = File.join(view_path.to_s, 'styleguides')
        if File.exists?(styleguide_path)
          Dir.glob(styleguide_path + '/_*.*').map { |file| file.chomp(File.extname(file)) }
        else
          nil
        end
      end
      all_styleguide_partials.flatten.compact
    end
  end

end
Something went wrong with that request. Please try again.