jeudi 13 juillet 2017

Check box not updating the DB using Rails 4

I have a column called vacant in my listings table. It is a Boolean, but it is not updating when I check it and save. I have added it to my strong params in the listings_controller.rb, I made sure it's inside my loop, but still not sure.

schema.rb:

t.boolean  "vacant", default: false

_form.html.erb:

<div class="field">
  <label for="vacant_listing" class="general-text-label">Vacant Listing - Only check if apartment is vacant!</label><br>
  <%= f.check_box :vacant %> <br />
</div>




Aucun commentaire:

Enregistrer un commentaire