Skip to content


Subversion checkout URL

You can clone with
Download ZIP


How do I set the value names of many_to_many inputs #814

jwaldrip opened this Issue · 3 comments

2 participants


I am trying to generate a list of contacts and I want the input to display a value of contact.first_name + " " + contact.last_name. When I use the following code I get the value of each contact as an object_id.

= f.input :contacts, as: :select_inline, label: false, input_html: { class: "inline chzn-select", :'data-placeholder' => "Choose a Contact" }

Note: select_inline is a custom input nearly identical to the orignal select input.


Here's a quote from the documentation for SelectInput, which I assume you haven't read (but please help me clarify the docs if it simply didn't make sense to you):

The way on which Formtastic renders the value attribute and content of each <option> tag is customisable through the :member_label and :member_value options. When not provided, we fall back to a list of methods to try on each object such as :to_label, :name and :to_s, which are defined in the configurations collection_label_methods and collection_value_methods (see examples below).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.