dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-26 05:24 UTC
attachment_fu undefined method `upload_data=''
Uh, I''m kind of trying to follow the Mike Clark tutorial on attachment_fu but uh, seems it is incomplete... I get this error on submitting the form with upload undefined method `upload_data='' What''s that? Where do I define that? I''m guessing in the model file, but what do I define it as?! Also, in the model file, has_attachment options list :processor => Rmagick doesn''t work, as a symbol or with quotes around Rmagick. What is the expected syntax here? Thanks for any help. (yes I''ve kind of given up on my own uploads for now... but not forever, I''ll break out of plugins quick as I can) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I get this error on submitting the form with upload > undefined method `upload_data='' > > What''s that? > Where do I define that? I''m guessing in the model file, but what do I > define it as?!uploaded_data is the attachment_fu method that deals with the uploaded file. You shouldn''t have to define it - you just need to have your model configured correctly> Also, in the model file, > has_attachment options list > :processor => Rmagick > doesn''t work, as a symbol or with quotes around Rmagick. > What is the expected syntax here?You do need quotes around Rmagick. What is your actual model code - options and list look like placeholders. My suspicion is that your has_attachment configuration line has a syntax error and so attachment_fu is not getting invoked to deal with the file.> > Thanks for any help. > (yes I''ve kind of given up on my own uploads for now... but not > forever, I''ll break out of plugins quick as I can) > > > > >-- Cynthia Kiser cynthia.kiser-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-26 12:09 UTC
Re: attachment_fu undefined method `upload_data=''
class Mugshot < ActiveRecord::Base has_attachment :content_type => :image, :storage => :file_system, :max_size => 500.kilobytes, :resize_to => ''300x300>'', :thumbnails => { :thumb => ''100x100>'' } validates_as_attachment end ---this should be fine! I only have ImageMagick and RMagick installed, none of the others. With or without the :processor => ''Rmagick'' Still error! my schema: ActiveRecord::Schema.define(:version => 1) do create_table "mugshots", :force => true do |t| t.column "parent_id", :integer t.column "content_type", :string t.column "filename", :string t.column "thumbnail", :string t.column "size", :integer t.column "width", :integer t.column "height", :integer end end --My controller: class MugshotController < ApplicationController def new @mugshot = Mugshot.new end def create @mugshot = Mugshot.new(params[:mugshot]) if @mugshot.save flash[:notice] = "Mugshot was successfully created." redirect_to mugshot_url(@mugshot) else render :action => ''new'' end end end I don''t get it. The Mike Clark tutorial gets all these raves from lots of people. It''s ok, missing some details perhaps, but doesn''t seem to work for me. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-27 04:36 UTC
Re: attachment_fu undefined method `upload_data=''
Does anybody have any code samples of working attachment_fu ? Any other tutorials than the Mike Clark page? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 26 Jul 2007, at 13:09, dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> class Mugshot < ActiveRecord::Base[snip]> my schema:[snip]> --My controller:[snip] That code all looks good. How about your view code? I notice that the subject of this thread mentions "upload_data=" when the actual method is "uploaded_data=". Regards, Andy Stewart --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---