title: ruby on rails - paperclip - nohandleerror - no handler found for
body: <p>I have a application that I use for posting stuff. I want a user to be able to write feedback to me and want them to be able to upload a screenshot as well.</p>
  
  <p>I have written a model, controller and stuff by myself.</p>
  
  <pre><code>&lt;div id="feedback-message" class="feedback-message" style="color: green;"&gt;Feedback sent&lt;/div&gt;
  &lt;span class="label label-info"&gt;Name&lt;/span&gt;&lt;%= text_field_tag :name, "", class: 'form-control' %&gt;
  &lt;span class="label label-info"&gt;Topic&lt;/span&gt;
  &lt;select name="topic" id="topic" class="form-control"&gt;
    &lt;option value="Bug"&gt;Bug&lt;/option&gt;
    &lt;option value="Suggestion"&gt;Suggestion&lt;/option&gt;
    &lt;option value="Other"&gt;Other&lt;/option&gt;
  &lt;/select&gt;
  &lt;span class="label label-info"&gt;Screenshot&lt;/span&gt;
  &lt;label class="image-upload form-control"&gt;
    &lt;i class="fa fa-cloud-download" id="upload_button"&gt;&lt;/i&gt;
    &lt;input id="upload_input" type="file" name="feedback[screenshot]"/&gt;
  &lt;/label&gt;
  &lt;span class="label label-info"&gt;Message&lt;/span&gt; &lt;%= text_area_tag :message, "", class: 'form-control', rows: 3 %&gt;
  &lt;hr&gt;
  &lt;%= submit_tag 'Submit', id: 'submit-feedback', class: 'btn btn-success center' %&gt;
  
  &lt;script&gt;
      $(document).ready(function () {
          var msg = document.getElementById('feedback-message');
          var submit = $('#submit-feedback');
          submit.click(function () {
              msg.style.display = 'block';
              submit.prop('disabled', true);
              setTimeout(function () {
                  submit.prop('disabled', false);
                  msg.style.display = 'none';
              }, 5000);
              $.ajax({
                  url: '/feedback',
                  type: 'POST',
                  data: {
                      authenticity_token: $('[name="authenticity_token"]').val(),
                      name: $('#name').val(),
                      message: $('#message').val(),
                      topic: $('#topic').val(),
                      screenshot: $('#upload_input').val(),
                  },
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I display it by clicking on a button ( appears as a modal ).</p>
  
  <p>Worked fine before I tried implementing the screenshot. Followed the install guide from paperclip and when submitting a form I get </p>
  
  <pre><code>Paperclip::AdapterRegistry::NoHandlerError - No handler found for "C:\\fakepath\\wahtdihdijustread.jpeg":
    app/controllers/feedback_controller.rb:6:in `create'
  </code></pre>
  
  <p>Edit:</p>
  
  <pre><code>class Feedback &lt; ApplicationRecord
    validates :name, presence: true, length: {minimum: 3}
    validates :message, presence: true, length: {minimum: 5}
    validates :topic, length: {minimum: 3}
  
    has_attached_file :screenshot,
                      path: '/feedback/:filename',
                      url: '/feedback/:filename'
    validates_attachment_content_type :screenshot, content_type: /^image\/(jpg|jpeg|png)$/, message: 'file type is not allowed (only jpg/jpeg/png images)'
  end
  </code></pre>
  
  <p>Edit2:</p>
  
  <pre><code>class FeedbackController &lt; ApplicationController
    def index;
    end
  
    def create
      Feedback.create name: params[:name], message: params[:message], topic: params[:topic], screenshot: params[:screenshot]
      authorize Feedback
    end
  end
  </code></pre>