Q:

checkbox always passing false

I have this form in a view
div
  = label_tag "choice[has_pictures]", "Choice can have pictures?"
  = check_box_tag "choice[has_pictures]", choice.has_pictures, choice.has_pictures

but, everytime I submit it, I always get the parameter has_pictures as false. I don't know what I'm missing, if it's something with slim or not
I'm using Rails 4.0.11

A:

I believe, you could put a breakpoint (even within a view!) and check what is the value of that choice.has_pictures. 
Probably, it is nil or there may be an error with your method name, as most of them are called in a way when boolean-returning method' name ends with a question mark: choice.has_pictures? (and that is the good practice to have such a wrapping method for a model' boolean field).
There's nothing wrong with Slim - it just puts to the output the result of the Rails' helper method check_box_tag call.
Yet, there's one more hint from Rails docs: you're using the wrong value attribute for the check_box_tag method: 
check_box_tag(name, value = "1", checked = false, options = {})
If your model has no pictures (has_pictures == false), the corresponding param will be returning false when the checkbox is checked and nil when it's not.
Check this out:
<input value="false" name="option_name" />

If it is checked, then params["option_name"] == false. If it is not, params["option_name"] == nil.
So, I'd suggest you to use this in a more convenient way:
= check_box_tag "choice[has_pictures]", true, choice.has_pictures

