I have a column in database with datatype boolean
class Table < ActiveRecord::Migration
def change
create_table :services do |t|
t.boolean :recommend, :default => false
t.timestamps
end
end
end
I want use to click a button or check yes or no to a form so when user submits a review, they would recommend and change the database to true.
How would I do such a thing?
I have a button:
<div class="field-container"><%= f.button :recommend %></div>
If user clicks on it, I'm not sure if it'll save true to database? Do I need to add more to this?
Thanks!