I'm using dropzone-rails to add dropzone to my Rails app. I'm using CarrierWave for image uploads which is working fine without Dropzone.
I'm getting an error when I drop an image onto my dropzone form. The form is located on the edit page of my "Canvas" model.
Form html
<%= form_for(@canvas, :html => { :class => 'dropzone', :id => 'awesomeDropzone' }) do |f| %>
<%= f.file_field :image %>
<%= f.submit %>
<% end %>
Dropzone JS call
Dropzone.options.awesomeDropzone = {
paramName: "canvas[image]", // The name that will be used to transfer the file
clickable: false
};
Console error:
GET http://localhost:3000/canvases/21/edit 500 (Internal Server Error)
canvases_controller.rb
def edit
@canvas = Canvas.find(params[:id])
end
def update
@canvas = Canvas.find(params[:id])
if @canvas.update_attributes(update_params)
redirect_to edit_canvas_path(@canvas)
else
render :edit
end
end
canvas.rb
mount_uploader :image, ImageUploader
config.consider_all_requests_local = true) and look at the actual error and stack trace. - coreywardRAILS_ENVset to development, this is the default, and you'll see an error and stack trace output. If you're running in a different environment (specifically, production), by default you won't see errors. You can either adjust the setting in the relevantconfig/environments/____.rbfile or change the environment you're booting in. Since this is localhost, you probably just want to run in development mode. - coreyward./log/#{environment}.log. - coreyward