Sha256: 705cc11bfc88c35a80be2102ee1134b18b8b0b3748fc4640a00a687e378e4166

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

- name_without_id_or_type = name.sub(/_(id|type)$/, '')

- if f.object.class.reflect_on_association(name_without_id_or_type).try(:options).try('[]', :polymorphic) == true
  -# name =~ /_id$/ is required to prevent user template from being renedred 2x times:
  -# first time for _id field, second time for _type field
  - if name =~ /_id$/ && has_template?( "_#{view_prefix}.#{name_without_id_or_type}" )
    = render "#{view_prefix}.#{name_without_id_or_type}", :f => f, :name => name, :view_prefix => view_prefix

- else
  - if has_template? "_#{view_prefix}.#{name}"
    = render "#{view_prefix}.#{name}", :f => f, :name => name, :view_prefix => view_prefix
  - else

    - render_field_type, use_i18n = render_field_type(f.object, name)

    - if use_i18n and has_template?( "_edit.field_type_#{render_field_type}_i18n" )
      = render "edit.field_type_#{render_field_type}_i18n", :f => f, :name => name

    - elsif has_template? "_edit.field_type_#{render_field_type}"
      = render "edit.field_type_#{render_field_type}", :f => f, :name => name

    - else
      = render "edit.field_type_text", :f => f, :name => name

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
releaf-0.1.2 app/views/releaf/base/_edit.field.html.haml