0

I want to be able to have one select which specifies the value of two model attributes. Therefore if you were to select "yes" on a drop-down it would set the value of attribute a and attribute b to "yes" when the form is submitted. Although the below doesnt work it might help explain what I mean:

= f.select :trial, :free , [['Yes', 'true'], ['No', 'false']], {}, class: 'selectpicker mandatory'

1 Answer 1

1

You can not do that.

What you can do instead, is upon validating the object set the free attribute equal to trial (that was set by selecting from a dropdown).

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah I had been using that approach but thought it would be good to take the other approach. Alas it is not possible so will go with my original approach. Thanks anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.