How to disable a select associaition of the simple form

0

I have a select association of the simple form, the value of it passing through controler and I would like that in form the user did not have the option to select another value. I have tried to use disabled: true disabled: true, input_html: {disabled: true} and readonly: true None of these have solved the problem, always allowing you to select another value in the select . Any suggestions on how to display the selected value without the user selecting another one?

    
asked by anonymous 07.07.2016 / 22:11

1 answer

1

You can change the select field to a simple text field when you are in the edit screen or do not put any text field in a div.

Another option is to keep like this and create a rule in the before_update model, not allowing the value initially registered to be unchanged.

    
22.07.2016 / 20:49