ruby on rails - Choosing between two bolean methods when setting up a form -


I am scratching heads for hours now, how to try to figure out how to do it properly I have a form I am creating, and the user wants to choose between two options: "lemonade" or "pepsi" .

Two booleans have been found in my database as "lemonade" and "pepsi" , and one The way to uncheck the second checkbox when one is first, or select only one of them in the drop down menu (where checked = true ). In other words, when is showing "P list" , then I should say Pepsi = true / lemon water = false or vice versa. I have tried to use assumptions, but it is not working any good idea?

Hope the question was understandable.

FYI: New for ROR

I think you used to create boolean columns Time should use a default value, its original value will be lemonade or pepsi then in your opinion, you will display the checkbox with the value that is different default value , Example:

If your default value is Lineded , you will be displaying the checkbox with the price Pepsi Therefore, if the user does not check, then the user with the default option is lemonade , and if the user is checked Pepsi , then you can choose that option Will save You can put a checkbox with a label like: "If you do not check Pepsi, your choice will be lemonade". I think the solution will be for you in this case.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -