Class: BrainDamage::View::Display::InlineEditable

Inherits:
Base show all
Defined in:
lib/generators/brain_damage/lib/views/displays/inline_editable.rb

Instance Attribute Summary

Attributes inherited from Templateable::FieldTemplateable

#partial_html, #type

Attributes inherited from Templateable::Base

#inner_html, #options, #template_file

Instance Method Summary collapse

Methods inherited from Base

#dir

Methods inherited from Templateable::FieldTemplateable

#empty_haml_path, #label_guard?, #method_missing, #render, #show?, #show_label?

Methods inherited from Templateable::Base

#indent, #method_missing, #render, #render_erb_file, #render_erb_string, #render_template_file

Constructor Details

#initialize(field, options) ⇒ InlineEditable



8
9
10
11
# File 'lib/generators/brain_damage/lib/views/displays/inline_editable.rb', line 8

def initialize(field, options)
  super
  @if = options[:if] || nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BrainDamage::Templateable::FieldTemplateable

Instance Method Details

#conditions?Boolean



13
14
15
# File 'lib/generators/brain_damage/lib/views/displays/inline_editable.rb', line 13

def conditions?
  false
end

#display(identifier = :inline_editable_display) ⇒ Object



17
18
19
# File 'lib/generators/brain_damage/lib/views/displays/inline_editable.rb', line 17

def display(identifier = :inline_editable_display)
  field.display identifier
end

#input(identifier = :default) ⇒ Object



21
22
23
# File 'lib/generators/brain_damage/lib/views/displays/inline_editable.rb', line 21

def input(identifier = :default)
  field.input identifier
end