require_dependency "cssdoc_rails/application_controller"

module CssdocRails
  class CssdocsController < ApplicationController
    
    def index
      @documents = CssdocRails::Document.all
    end

    def show
      request.fullpath.slice!('/cssdocs/')
      path = "app/assets/stylesheets/#{request.fullpath}"
      @document = CssdocRails::Document.path_table[path.to_s] or render :nothing => true, :status => 404
      render 'show.html.erb'
    end

  end
end
