Sha256: 4d7f0542d00c9b816e3b2c47ae52f0574596b197fb70b972675699268d80c58b

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

class GridsController < ApplicationController
  def index
    @page_title = "Grid System<small>(s)</small>"
    @page_description = "This grid system is built to be flexible but still simple enough to read. It can scale up and down, it can fold up and it can be pushed around."
    @page_nav = grids_nav
  end

  def show
    if example_layouts.has_key? params[:id]
      render_example_layout params[:id], params[:format]
    else
      raise ActionController::RoutingError.new("Can not find example layout named: #{params[:id]}")
    end
  end

  def layouts
    @page_title = "Example Layouts."
    @page_description = "A few example layouts for experimentation"
    @page_nav = grids_nav
    @layouts = example_layouts
  end

  private 
  def grids_nav
    {
      "Grid Settings File" => grid_path +  "#Setting-Grids" ,
      "Grid Example" => grid_path + "#Live-Grid-Example" ,
      "Layouts" => grid_layouts_path
    }
  end

  def example_layouts
    {
      "basic-marketing-site" => "Basic Marketing Site",
      "jumbotron-site" => "Jumbotron Site"
    }
  end

  def render_example_layout( template, format )
    case format
    when "haml"
      render :text =>  File.open(Rails.root.join("app/views/grids/layouts/#{template}.haml")).read
    else
      render :template => "grids/layouts/#{template}.haml", :layout => false
    end
  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
plinth-0.0.1.beta.4 app/controllers/grids_controller.rb
sb-styleguide-1.2.2 app/controllers/grids_controller.rb
sb-styleguide-1.2.1 app/controllers/grids_controller.rb
sb-styleguide-1.2.0 app/controllers/grids_controller.rb
plinth-0.0.1.beta.3 app/controllers/grids_controller.rb
plinth-0.0.1.beta.2 app/controllers/grids_controller.rb
plinth-0.0.1.beta.1 app/controllers/grids_controller.rb
plinth-0.0.1.pre app/controllers/grids_controller.rb
sb-styleguide-1.1.0 app/controllers/grids_controller.rb
sb-styleguide-1.0.1 app/controllers/grids_controller.rb
sb-styleguide-1.0.0 app/controllers/grids_controller.rb