Sha256: 9309db9b65f23ae22aa9f05e813a2c2608fb08bc8d18a470862923fa50e40779

Contents?: true

Size: 612 Bytes

Versions: 9

Compression:

Stored size: 612 Bytes

Contents

<%
  field_name = "#{field.to_s.singularize}_id"
  field_id = "#{model.underscore}_#{field_name}"

	collection = field_collection(application, model, field, object)
	collection.insert(0, ['Todos',0])
	
	collection_selected = params[model.underscore][field_name] if params[model.underscore].present? and params[model.underscore][field_name].present?
	#collection_selected = object.send(field.to_s.singularize).id unless object.send(field.to_s.singularize).blank?
%>
<%= select_tag "#{model.underscore}[#{field_name}]", options_for_select(collection, collection_selected), { :class => "select2-me input-large" } %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
my_admin-0.1.13 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.12 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.11 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.10 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.9 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.8 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.7 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.6 app/views/my_admin/fields/filter/type/belongs_to.html.erb
my_admin-0.1.5 app/views/my_admin/fields/filter/type/belongs_to.html.erb