Class: AdminAssistant::PolymorphicBelongsToColumn::FormView

Inherits:
Column::View
  • Object
show all
Includes:
Column::FormViewMethods
Defined in:
lib/admin_assistant/polymorphic_belongs_to_column.rb

Instance Attribute Summary

Attributes inherited from Column::View

#sort_order

Instance Method Summary collapse

Methods included from Column::FormViewMethods

#after_html, #description, #errors, #field_id, #html, #html_from_helper_method, #render_from_custom_template, #set_instance_variables_from_options

Methods inherited from Column::View

#check_box_and_hidden_tags, #controller, #custom_template_file_path, #file_option_for_custom_template_render, #initialize, #label, #name, #paperclip?, #sort_possible?, #string, #value

Constructor Details

This class inherits a constructor from AdminAssistant::Column::View

Instance Method Details

#default_html(form) ⇒ Object



65
66
67
68
69
# File 'lib/admin_assistant/polymorphic_belongs_to_column.rb', line 65

def default_html(form)
  opts_for_select = @polymorphic_types.map { |t| [t.name, t.name] }
  form.select(name + '_type', opts_for_select, @select_options) + " " +
      form.text_field(name + '_id', :class => 'integer')
end