Randy Schmidt on 27 Apr 2007 14:02:31 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PhillyOnRails] Attachment_fu + production environment woes

  • From: "Randy Schmidt" <randy@umlatte.com>
  • To: "Philly on Rails ML" <talk@phillyonrails.org>
  • Subject: [PhillyOnRails] Attachment_fu + production environment woes
  • Date: Fri, 27 Apr 2007 10:02:20 -0400
  • Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=iv6hbUWvR3R1B3wiUmdamqotW2z8j0dhpa0GgFsJ3eS26h6eDxDDU6xC0E0MwcYvBAzA1kYFh9T83CDl/7I2i8QE6g3IIOIHRhALycGLnvhEmmoCvhTZqWcoGQp8b74M03OMwAedrnjjtB5/FLrxMaptAnF0Nr7X19lyQv0oYkU=
  • List-archive: <http://lists.phillyonrails.org/pipermail/talk>
  • Reply-to: talk@phillyonrails.org
  • Sender: talk-bounces@phillyonrails.org

Hi,

I'm using the attachment_fu plugin to upload audio and images to a
website I am working on. Everything works great on the development
platform, however, not so great on the production server. It works
fine in production uploading audio, however, when I try to upload an
image, it uploads the file (I'm guessing since there is a pause
between when I hit the buttom to upload and being redirected) but then
it doesn't create the record or move the file to the correct location.

I initially thought it was a permissions issue but then as I started
to look in the production log, I noticed it never calls the "create"
action. I am not processing the images after they are uploaded (I'm
deploying to dreamhost and I have never been able to get rmagick to
work on their servers).

Does anybody have any ideas? Is there another way I can look at what's
going on in the production environment? Keep in mind this works 100%
in the development environment. I think my next attempt is going to be
to run it in the development environment on the production server (if
dreamhost lets me).

The model/controller/log/view are below.

Thanks,
Randy

create form:

<% form_for(:image, :url => images_path, :html => { :multipart => true
}) do |f| -%>

	<dl>
		<dt><label for="image_name">Name:</label> <span
class="formHelp">Required</span></dt>
		<dd><%= f.text_field :name, :size => 60, :maxlength => 250 %></dd>

		<dt><label for="image">Upload an Image:</label></dt>
		<dd><%= f.file_field :uploaded_data %></dd>

		<dt><label for="image_description">Description:</label></dt>
		<dd><%= f.text_area :description, :cols => 60, :rows => 10 %></dd>
	</dl>
 <p><%= submit_tag "Upload" %> or <%= link_to 'Cancel', images_path,
:class => 'cancel' -%></p>

<% end -%>


Controller update action:

def create
 @image = Image.new(params[:image])
 if @image.save
   flash[:notice] = 'Image was successfully created.'
   redirect_to images_url
 else
   render :action => :new
 end
end


Model:

class Image < ActiveRecord::Base

 has_attachment  :content_type => :image,
                 :storage => :file_system,
                 :path_prefix => 'public/images/uploaded',
                 :processor => :none

 validates_as_attachment
 validates_presence_of :name
end


Production log showing the create action being "skipped":

Processing ImagesController#index (for 71.225.14.59 at 2007-04-27
05:43:54) [GET]
 Session ID: 9fa9d6b862733a2fc6f042ee427ef7c8
 Parameters: {"action"=>"index", "controller"=>"images"}
Rendering  within layouts/admin
Rendering images/index
Completed in 0.50085 (1 reqs/sec) | Rendering: 0.04366 (8%) | DB:
0.03972 (7%) | 200 OK [http://clc.3strandstudio.com/images/]


Processing ImagesController#new (for 71.225.14.59 at 2007-04-27 05:45:09) [GET] Session ID: 9fa9d6b862733a2fc6f042ee427ef7c8 Parameters: {"action"=>"new", "controller"=>"images"} Rendering within layouts/admin Rendering images/new Completed in 0.17374 (5 reqs/sec) | Rendering: 0.04949 (28%) | DB: 0.00000 (0%) | 200 OK [http://clc.3strandstudio.com/images/new]


Processing ImagesController#index (for 71.225.14.59 at 2007-04-27 05:45:32) [GET] Session ID: 9fa9d6b862733a2fc6f042ee427ef7c8 Parameters: {"action"=>"index", "controller"=>"images"} Rendering within layouts/admin Rendering images/index Completed in 0.00905 (110 reqs/sec) | Rendering: 0.00353 (39%) | DB: 0.00485 (53%) | 200 OK [http://clc.3strandstudio.com/images/]

--
Randy Schmidt
randy@umlatte.com
www.umlatte.com
267.334.6833
_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk