How can I add two label elements when choosing association in Simple Form on Ruby on Rails?
Sample: @user.name = "Barack"
and
@user.last_name = "Obama"
Here is my code:
<%= f.association :persona, :collection => Persona.order(:name),
:prompt => 'Choose a person' %>
It displays only Barack but I need it to display not only name
but also last_name
when choosing from list.
Here is the answer - you need a complex label_method.