Is there a rails gem to use a single table for all of the "options" in multiple select inputs throughout an app? -


Therefore, sometimes you just need a list of options for your selection. Is there a simple gem from your app that makes it easy to use a table for all your options?

This table might be visible:

  id | Type | Price | Label 01 Color | Lal Red 02 Color | Black | Black 03 | Size | Cycle Circle 04 | Size | Class | Square 05 | State | Texas | For example, a list of countries, a list of states, a list of colors, a list of months, etc. ...  

Then when making a selection:

  select_tag : Color, options_for_colors   

Then it will populate selection with options with values ​​/ labels from some options table, where in the rows type: color.

It would be easy for me to roll on myself, but I do not want to spend the time already made. I always use this method,

app / model / user.rb

 
Code> ROLES =% w [Administrator author generic]

App / view / user / _form.html.erb

     

Comments