Sha256: 0bcad9a83f6bf8a1dc2ba09e07c2c4c718db6d53e460da4cc46fa80c3a9c01c6

Contents?: true

Size: 515 Bytes

Versions: 8

Compression:

Stored size: 515 Bytes

Contents

class ComponentsController < ApplicationController
  layout 'components'

  helper_method :components_category, :components_category?

  def index
    render_for_components
  end

  def show
    render_for_components
  end

  private

  def render_for_components
    if components_category?
      render "components/#{components_category}/#{params[:action]}"
    else
      render
    end
  end

  def components_category
    params[:components]
  end

  def components_category?
    !!params[:components]
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
styleus-0.0.12 app/controllers/components_controller.rb
styleus-0.0.11 app/controllers/components_controller.rb
styleus-0.0.10 app/controllers/components_controller.rb
styleus-0.0.9 app/controllers/components_controller.rb
styleus-0.0.8 app/controllers/components_controller.rb
styleus-0.0.7 app/controllers/components_controller.rb
styleus-0.0.6 app/controllers/components_controller.rb
styleus-0.0.5 app/controllers/components_controller.rb