ruby - Rails checkboxes -


In my database there is a string column, which is the "artist" or "listener", and I want the user to send the appropriate checkbox Clicking is able to choose which string is populated with columns. How can you do it?

You should use the radio button here:

  # User model and user-typed field  & Lt;% = f.radio_button: user_type, "listener"%> & Lt;% end% & gt;    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -