Randy Schmidt on 27 Apr 2007 14:02:31 -0000 |
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 -%>
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
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
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/]
-- 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
|
|