Sha256: dc272dfd68cc18f510a922202369ec07f2f4ffdabce4c9452d52e1db76e87969

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

module AbstractInterface
  module ViewHelper
    # 
    # Basic
    # 
    def b
      @b ||= AbstractInterface::ViewBuilder.new self
    end
    alias_method :builder, :b

    def themed_resource resource
      "/#{AbstractInterface.plugin_name.should_not_be!(:blank)}/themes/#{current_theme.name}/#{resource}"
    end

    # def current_layout
    #   @current_layout || "default"
    # end
    
    
    
    
    
    
    
    def build_layout layout = nil
      # Configuring
      current_theme.layout = layout

      #  Rendering
      current_theme.layout_definition['slots'].each do |slot_name, slots|
        slots = Array(slots)
        slots.each do |partial|
          content_for slot_name do
            render :partial => partial
          end
        end
      end
    end  
      
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-ext-0.3.28 lib/abstract_interface/view_helper.rb