Answer the question
In order to leave comments, you need to log in
How to set a condition for a specific field in the select pop-up list in the view in ruby on rails?
Help, please, with one problem. I have a popup list, but I need to make 2 conditions for one of the fields. Essentially throw this check_box condition
- if policy(@callcenter).activate_trial?
= f.check_box :trial_mode, disabled: [email protected]_mode_allowed, custom: :switch
= f.select :status, t_enum_for_select(Callcenter, :statuses)
Answer the question
In order to leave comments, you need to log in
Still managed to solve the problem
= f.select :account_status, t_enum_for_select(Callcenter, :account_statuses),
disabled: ['suspended', ('trial' if [email protected]_mode_allowed || policy(@callcenter).activate_trial?)]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question