Module: Glib::JsonUi::ViewBuilder::Panels::ModelPanel

Included in:
Fields::DynamicGroup, Association
Defined in:
app/helpers/glib/json_ui/view_builder/panels.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#assoc_order_indexObject (readonly)

Returns the value of attribute assoc_order_index.



1042
1043
1044
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1042

def assoc_order_index
  @assoc_order_index
end

#model_nameObject (readonly)

See Panels::Form.field_name



1041
1042
1043
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1041

def model_name
  @model_name
end

Instance Method Details

#field_assert_respond_to(prop) ⇒ Object



1077
1078
1079
1080
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1077

def field_assert_respond_to(prop)
  raise "Please specify a model for #{self.class.component_name} before using its property" unless @model
  @delegate_class.field_assert_respond_to(@model, prop)
end

#field_label(prop, args) ⇒ Object



1061
1062
1063
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1061

def field_label(prop, args)
  @delegate_class.field_label(@model, @model_name, prop, args)
end

#field_name(prop, multiple) ⇒ Object



1053
1054
1055
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1053

def field_name(prop, multiple)
  @delegate_class.field_name(@model, prop, multiple, page)
end

#field_validation(prop) ⇒ Object



1073
1074
1075
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1073

def field_validation(prop)
  @delegate_class.field_validation(@model, prop)
end

#field_value(prop, collect_ids: true) ⇒ Object



1057
1058
1059
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1057

def field_value(prop, collect_ids: true)
  @delegate_class.field_value(@model, prop, collect_ids: collect_ids)
end

#hint_label(prop, args) ⇒ Object



1065
1066
1067
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1065

def hint_label(prop, args)
  @delegate_class.hint_label(@model_name, prop, args)
end

#model(model) ⇒ Object



1044
1045
1046
1047
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1044

def model(model)
  @model = model
  @model_name = @model.class.model_name.singular
end

#order_index(index) ⇒ Object



1049
1050
1051
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1049

def order_index(index)
  @assoc_order_index = index
end

#placeholder_label(prop, args) ⇒ Object



1069
1070
1071
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 1069

def placeholder_label(prop, args)
  @delegate_class.placeholder_label(@model_name, prop, args)
end