Class: BelongsToTokenInput

Inherits:
Formtastic::Inputs::StringInput
  • Object
show all
Defined in:
app/inputs/belongs_to_token_input.rb

Instance Method Summary collapse

Instance Method Details

#input_html_optionsObject



3
4
5
6
7
8
9
10
11
12
# File 'app/inputs/belongs_to_token_input.rb', line 3

def input_html_options
	super.merge(
		"data-token-limit" => 1,
		"class" => "active-admin-tokeninput",
		"data-field-name" => "#{object_name.underscore}[#{method.to_s.singularize}_id]",
		"data-pre" => "[#{object.send("#{method}").to_json(:only => [:id, :name])}]",
		"name" => "",
		"value" => "",
		)
end