Class: Georgia::LinkPortlet

Inherits:
Portlet show all
Defined in:
app/presenters/georgia/link_portlet.rb

Instance Attribute Summary

Attributes inherited from Portlet

#portlet

Attributes inherited from Presenter

#view_context

Instance Method Summary collapse

Methods inherited from Portlet

#handle_tag, #id, #portlet_tag

Constructor Details

#initialize(view_context, link, args = {}) ⇒ LinkPortlet

Returns a new instance of LinkPortlet.



6
7
8
9
# File 'app/presenters/georgia/link_portlet.rb', line 6

def initialize view_context, link, args={}
  @content = args.fetch(:content, link.content)
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Georgia::Presenter

Instance Method Details

#to_sObject



11
12
13
14
15
16
17
18
19
20
# File 'app/presenters/georgia/link_portlet.rb', line 11

def to_s
  form = ActiveSupport::SafeBuffer.new
  form << handle_tag
  form << link_form_fields
  form << actions_tag
  output = ActiveSupport::SafeBuffer.new
  output << (:div, form)
  output << (last_descendant? ? empty_portlet_list : children_portlets)
  portlet_tag(output)
end