Class: Basepack::Forms::Show

Inherits:
Base
  • Object
show all
Defined in:
lib/basepack/forms/show.rb

Instance Attribute Summary

Attributes inherited from Base

#association_chain, #factory, #groups, #nested_in, #partial, #resource, #resource_class, #view

Instance Method Summary collapse

Methods inherited from Base

#build_from_factory, #chain, #chain_with_class, #configure, #content_for_field, #default_group, #field, #field_names, #fields, #fields_hash, #group, #has_field?, #hide_field, #hide_fields, #initialize, #inspect, #inverse_of_nested_in?, #label, #label_plural, #new_form, #new_record?, #path, #permit_params, #render_field, #sanitize_params, #show_fields, #show_only_fields, #translate, #visible_field, #visible_fields, #visible_groups, #with_resource

Constructor Details

This class inherits a constructor from Basepack::Forms::Base

Instance Method Details

#default_partialObject



4
5
6
# File 'lib/basepack/forms/show.rb', line 4

def default_partial
  'forms/show'
end

#render_field!(field) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/basepack/forms/show.rb', line 8

def render_field!(field)
  if field.partial_show.present?
    view.render field.partial_show, form: self, field: field
  else
    view.form_field_show(field)
  end
end