Class: TypeStation::ContentPresenter
Instance Method Summary
collapse
#initialize
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class TypeStation::BasePresenter
Instance Method Details
#link(default, html_options = nil, &block) ⇒ Object
10
11
12
13
|
# File 'app/presenters/type_station/content_presenter.rb', line 10
def link(default, html_options = nil, &block)
css_class = html_options.delete(:class) if html_options.include?(:class)
content_tag(:a, nil, html_options.merge({class: ['ts-editable-link-tag', css_class], href: link_href(default), data: link_data_attribute }), &block)
end
|
#tag(default, options = {}) ⇒ Object
5
6
7
8
|
# File 'app/presenters/type_station/content_presenter.rb', line 5
def tag(default, options = {})
css_class = options.delete(:class) if options.include?(:class)
cl_image_tag((content.present? ? content['identifier'] : default), options.merge({class: ['ts-editable-image-tag', css_class], data: options}))
end
|
#value ⇒ Object
19
20
21
|
# File 'app/presenters/type_station/content_presenter.rb', line 19
def value
sanitized_value
end
|
#value_is_hash? ⇒ Boolean
15
16
17
|
# File 'app/presenters/type_station/content_presenter.rb', line 15
def value_is_hash?
content.is_a? Hash
end
|