Class: BakeryTheme::ObjectListHelper::ObjectListItem
- Inherits:
-
Object
- Object
- BakeryTheme::ObjectListHelper::ObjectListItem
- Defined in:
- app/helpers/bakery_theme/object_list_helper.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(object, options, template) ⇒ ObjectListItem
constructor
A new instance of ObjectListItem.
- #to_html ⇒ Object
Constructor Details
#initialize(object, options, template) ⇒ ObjectListItem
Returns a new instance of ObjectListItem.
60 61 62 63 64 |
# File 'app/helpers/bakery_theme/object_list_helper.rb', line 60 def initialize(object, , template) @object = object @options = @template = template end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
66 67 68 |
# File 'app/helpers/bakery_theme/object_list_helper.rb', line 66 def object @object end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
66 67 68 |
# File 'app/helpers/bakery_theme/object_list_helper.rb', line 66 def @options end |
Instance Method Details
#to_html ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'app/helpers/bakery_theme/object_list_helper.rb', line 68 def to_html content = "" content << %(<a name="#{[:ref]}"></a>).html_safe if [:ref] content << %(<span class="icon"></span>) inner_contents = %(<h3 class="file_name">#{h [:name]}</h3>).html_safe content << content_tag(:div, inner_contents, :class => "item_contents") item = content_tag :div, content.html_safe, :class => ["ui-widget-content", "ui-helper-clearfix"].compact.join(" ") content_tag :li, item, :id => dom_id(object), :class => [dom_class(object), "ui-widget", "ui-helper-clearfix", [:type]].compact.map(&:to_s).join(" ") end |