title: Disabled Button if Textbox nil Ruby on Rails / Devise / Simple Form
body: <p>I am trying to have a class change if the text field of my Simple_form is empty/nil and using ruby not jquery to do so.</p>
  
  <p>My goal is to have a button disabled if the user has not put any text in and allow them to comment once they have. 
      
      &lt;%= simple_form_for([@message, @message.comments.build]) do |f| %></p>
  
  <pre><code>  &lt;div class="field"&gt;
      &lt;%= f.input :content, label: "Reply" %&gt;
    &lt;/div&gt;
  
    &lt;% if @message.comments.present? %&gt;
      &lt;%= f.button :submit, class: "ui disabled button" %&gt;
    &lt;% else %&gt;
      &lt;%= f.button :submit, class: "ui green button" %&gt;
    &lt;% end %&gt;
  
  &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Let me know if I am heading the right direction with this?</p>