title: IF statements in HAML form not working as expected
body: <p>I have an "<em>Accept/Reject</em>" workflow for tasks (created with nested forms via Cocoon). Basically, </p>
  
  <p><strong>if</strong> 1) the current user is the assignee (<code>current_user.email == :assignee</code>), 2) the current user is not the creator (<code>current_user.email != :creator</code>), and 3) the task has not been accepted (<code>true</code>) or rejected (<code>false</code>) i.e. nil (<code>:accepted != nil</code>), </p>
  
  <p><strong>then</strong> 1) show the creator (<code>:creator</code>) and 2) the enabled field to accept or reject (<code>f.select :accepted</code>)</p>
  
  <p>When I am using these if statements, the fields (creator &amp; accept/reject) are showing regardless of whether the condition is true or false. In addition, I am not allowed to use <code>current_user.email</code> in my if statement even though I can print it just fine.</p>
  
  <p>Here's my code:</p>
  
  <p>_task_fields.html.haml (views > projects)</p>
  
  <pre><code>.nested-fields
      .field
          = f.label :description
          = f.text_field :description
      .field
          = f.label :done
          = f.check_box :done
      - if (:accepted != nil) &amp;&amp; (:creator != nil)
          .field
              = f.label :creator
              = f.text_field :creator, :disabled =&gt; true
          .field
              = f.label :accepted, "Accept or Reject"
              = f.select :accepted, options_for_select([nil,['Accept',true],['Reject',false]])
      .field
          = current_user.email
          = f.label :priority
          - if :priority == nil
              = f.select :priority, options_for_select(["None","Low","High"],"None")
          - else
              = f.select :priority, options_for_select(["None","Low","High"],:priority)
      .field
          = f.label :assignee
          = f.select :assignee, User.pluck(:email), :prompt =&gt; "Select One"
      = link_to_remove_association "remove task", f, :class =&gt; "btn btn-default btn-sm"
  </code></pre>
  
  <p>_form.html.haml (views > projects)</p>
  
  <pre><code>= form_for @project do |f|
    .jumbotron
      %h3 Project Settings
      .field
        = f.label :title
        = f.text_field :title
  
      #category
      .form_row
        = f.label :category
        - if @project.category == "process"
          = f.radio_button :category, "process", :checked =&gt; 'checked'
          = "process"
          = f.radio_button :category, "checklist", :checked =&gt; @project.category == "checklist"
          = "checklist"
        - else @project.category == "checklist"
          = f.radio_button :category, "process", :checked =&gt; @project.category == "process"
          = "process"
          = f.radio_button :category, "checklist", :checked =&gt; 'checked'
          = "checklist"
  
      .field
        = f.label :description
        = f.text_field :description
  
    - if @project.category == "process"
      %h3 Steps
      #steps
        = f.fields_for :steps do |step|
          %ul.list-group
            = render 'step_fields', :f =&gt; step
        .links
          = link_to_add_association 'add step', f, :steps
    - if @project.category == "checklist"    
      #tasks
        = f.fields_for :tasks do |task|
          .jumbotron
            = render 'task_fields', :f =&gt; task
        .links
          .jumbotron
            = link_to_add_association 'add task', f, :tasks, :partial =&gt; 'projects/new_task_fields', :class =&gt; "btn btn-default btn-sm"
    = f.submit
  </code></pre>
  
  <p>projects_controller.rb (just the relevant parts)</p>
  
  <pre><code>def update
      respond_to do |format|
        if @project.update(project_params)
          format.html { redirect_to @project, notice: 'Project was successfully updated.' }
          format.json { render :show, status: :ok, location: @project }
          format.js
        else
          format.html { render :edit }
          format.json { render json: @project.errors, status: :unprocessable_entity }
          format.js
        end
      end
    end
  
  def project_params
        params.require(:project).permit(:title, :category, :description, tasks_attributes: [:id, :description, :done, :priority, :assignee, :creator, :created_at, :accepted, :completed_at, :_destroy])
      end
  </code></pre>
  
  <p>schema.rb (just the relevant parts)</p>
  
  <pre><code>create_table "tasks", force: true do |t|
      t.string   "description"
      t.boolean  "done"
      t.integer  "project_id"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.datetime "due"
      t.boolean  "started"
      t.boolean  "active"
      t.string   "repeat"
      t.integer  "time_limit"
      t.string   "priority"
      t.string   "assignee"
      t.string   "creator"
      t.datetime "started_at"
      t.datetime "completed_at"
      t.datetime "paused_at"
      t.datetime "resumed_at"
      t.integer  "time_spent"
      t.boolean  "accepted"
    end
  
    add_index "tasks", ["project_id"], name: "index_tasks_on_project_id"
  </code></pre>
  
  <p>I can add more files if necessary but I doubt my controller/model seems to be the issue. Thanks and appreciate any input.</p>