0

is it possible to pass a model-attribute of the collection to the select-options class?

<%= f.collection_select :bank_connection_id, BankConnection.all, :id, :bank_name, {:class => ? } %>

The Questmark shows where i wanted to use a attribute of the BankConnection. The attribute is named customer_id.

Background of this: I want to use the chained plugin for rails and therefore i must set the class to the specific customer-id.

Thanks for your help.

Tobias

Arup Rakshit
  • 116,827
  • 30
  • 260
  • 317
Tobias Münch
  • 829
  • 4
  • 13
  • If the current instance the `form` is for can access `customer_id` then you should be able to do `{ class: f.object.customer_id }`, where `f.object` is the reference to the current instance the form is built for. – vee Feb 18 '15 at 08:13
  • Sorry this did not help. I have switched to the select funktion according to the tutorial: http://homeonrails.blogspot.de/2012/01/rails-31-linked-dropdown-cascading.html – Tobias Münch Feb 18 '15 at 08:51

0 Answers0