mercredi 29 juillet 2015

Heroku Application Error After Form Submittal, But No Error Logged?

I get an error when I try to create a new form with image uploading to Amazon S3.

enter image description here

I think its because of my photo uploads, but not too sure. when I do this in my development environment, no issues. I'm using Amazon S3, in development as well.

I checked heroku logs and I get no error.

Once I create a new form, it supposed to direct me to that show.html.erb page, with the id in the URL (ie: http://ift.tt/1IKUiLH), but instead, it sent me to http://ift.tt/1npEVfG and the error.

Oh, I'm also using friendly_id gem

def create
  @project = project.new(project_params)

  respond_to do |format|
    if @project.save

      if params[:photos]
        params[:photos].each { |image|
          @project.project_images.create(photo: image)
        }
      end
      format.html { redirect_to @project, notice: 'Trip was successfully created.' }
      format.json { render :show, status: :created, location: @project }
  else
      format.html { render :new }
      format.json { render json: @project.errors, status: :unprocessable_entity }
    end
  end
end

When I go back to http://ift.tt/1IKUiLH, it works. But I only get this error right after I upload or submit a form.




Aucun commentaire:

Enregistrer un commentaire