All threads / Boolean wont update

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Boolean wont update

RJ McCollam asked in Rails

I have a column in my users table named active that is a boolean that defaults to true.

I cannot seem to update this value at all. Both in the console and through the update method in my users controller.

In my form I am using checkboxes for the boolean fields, and I have more than just the active column that I am updating. The other boolean column updates without issue.

The only sort of heads up I get is in the server logs — getting a 302 when I submit my form. This only happens when the value for active is different than true. If the value remains true I get a 200.

Feels like I am missing something super basic here.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 46,687+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.