Sha256: 2812a425e1c51f58836cb354350181c9f32c04a0081722a6653bd7819e4e85e4

Contents?: true

Size: 1000 Bytes

Versions: 111

Compression:

Stored size: 1000 Bytes

Contents

# -*- encoding : utf-8 -*-
InlineForms::SPECIAL_COLUMN_TYPES[:dropdown_with_values_with_stars]=:integer

# dropdown_with_values_with_stars
def dropdown_with_values_with_stars_show(object, attribute)
  values = attribute_values(object, attribute)
  link_to_inline_edit object, attribute, (object[attribute].nil? || object[attribute] == 0) ? "<i class='fi-plus'></i>".html_safe : image_tag(object[attribute].to_s + 'stars.png')
end
def dropdown_with_values_with_stars_edit(object, attribute)
  # the leading underscore is to avoid name conflicts, like 'email' and 'email_type' will result in 'email' and 'email[email_type_id]' in the form!
  values = attribute_values(object, attribute)
  collection_select( ('_' + object.class.to_s.underscore).to_sym, attribute.to_sym, values, 'first', 'last', :selected => object.send(attribute))
end
def dropdown_with_values_with_stars_update(object, attribute)
  object[attribute.to_sym] = params[('_' + object.class.to_s.underscore).to_sym][attribute.to_sym]
end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
inline_forms-6.2.14 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.12 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.11 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.10 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.9 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.7 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.6 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.5 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.4 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.3 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.2 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.2.1 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.1.1 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.1.0 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.0.8 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.0.7 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.0.6 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.0.5 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.0.4 app/helpers/form_elements/dropdown_with_values_with_stars.rb
inline_forms-6.0.3 app/helpers/form_elements/dropdown_with_values_with_stars.rb