Class: Storefront::Components::Sidebar

Inherits:
Base
  • Object
show all
Defined in:
lib/storefront/components/sidebar.rb

Constant Summary

Constant Summary

Constants included from Helpers::ContentHelper

Helpers::ContentHelper::SCOPES, Helpers::ContentHelper::SCOPES_WITH_NAMESPACE, Helpers::ContentHelper::SCOPES_WITH_NAMESPACE_AND_NESTED_MODEL, Helpers::ContentHelper::SCOPES_WITH_NESTED_MODEL

Instance Attribute Summary

Attributes inherited from Base

#options, #template

Instance Method Summary collapse

Methods inherited from Base

#component_name, #extract_classes!, #extract_options!, #initialize, #inside?, #pointer, #render, #render_with_pointer, #to_s

Methods included from Helpers::ContentHelper

#encoded_contents, #font_face_data_uri, #html5_time, #read_binary_file, #read_image_size, #rendered_text, #sanitize, #t?

Constructor Details

This class inherits a constructor from Storefront::Components::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Storefront::Components::Base

Instance Method Details



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/storefront/components/sidebar.rb', line 4

def sidebar(*args)
  locals  = args.extract_options!
  path    = args.shift
  if path.blank?
    path = resource.class.name.underscore.pluralize.to_sym rescue nil
  end
  if path.is_a?(Symbol)
    path = [path_namespace, path.to_s, "sidebar"].compact.join("/")
  end
  content_for :sidebar do
    render :partial => path, :locals => locals
  end
end


18
19
20
# File 'lib/storefront/components/sidebar.rb', line 18

def sidebar_record
  @sidebar_record
end