search for: uploaded_data

Displaying 20 results from an estimated 35 matches for "uploaded_data".

Did you mean: upload_data
2007 Aug 22
8
How to spec an attachment_fu model
First off, I''m not trying to spec attachment_fu, I know it''s been tested. But, I added some code to that model that I do need to test. Basically, I need to somehow fulfill the "uploaded_data" property so I can actually run my tests(otherwise they fail because of validations). The "uploaded_data" field is what would grab the multipart data from form. Here it is: # This method handles the uploaded file object. If you set the field name to uploaded_data, you do...
2007 Nov 09
9
fixture_file_upload and edge rspec?
...Helper After a couple other of tribulations, I have now gotten down to just a couple of not passing specs, all using the fixture_file_upload. Here''s an example it "should be invalid if uploaded file is not an image" do @image.attributes = valid_image_attributes.merge({:uploaded_data => fixture_file_upload(''/textfile.txt'', ''text/plain'')}) @image.should_not be_valid # content_type: is not included in the list @image.should have(1...
2006 May 31
4
acts_as_attachment , someone using it?
Hi, i just found the acts_as_attachment plugin for image upload, seems sogood but i cant find any docs about it, if someone here using it can give some references or working examples about the plugin that will be excellent. So what you wanna rails today? -- Posted via http://www.ruby-forum.com/.
2007 Sep 26
0
[Story] passing a file using post
...'t changed any of the sample application code. When I try to do the following: When "creating a new asset named", File.open(''/Users/multimedia/desktop/sample/assets/bridge.jpg'') do |path| post_via_redirect "/users/#{@user.login}/assets", :asset => { :uploaded_data => path } end Processing UserAssetsController#create (for 127.0.0.1 at 2007-09-26 14:49:10) [POST] Session ID: d7b173a79b7f1382dc3b037c73608233 Parameters: {"action"=>"create", "controller"=>"user_assets", "user_id"=>"Andrew&qu...
2007 May 22
3
Comments wanted about spec''ing out a couple controller methods
...ways I could improve the code, that would be great as well. Puzzle has_one Media. Both are AR model objects. class PuzzlesController < ApplicationController # a before_filter fills in @user def create @puzzle = Puzzle.new(params[:puzzle]) @puzzle.user = @user @media = Media.new(:uploaded_data => params[:media]) Puzzle.transaction do @puzzle.media = @media @puzzle.save! && @media.save! flash[:notice] = "Success!" redirect_to puzzle_path(@puzzle) end rescue ActiveRecord::RecordInvalid => e @media.valid? # force checking of errors eve...
2007 Dec 08
3
Uploading photos using facebook & attachment_fu
...<% facebook_form_for(:my_object, :url => { :action => ''upload_photo'', :id => params[:id] }, :html => { :multipart => true }) do |f| -%> <%= radio_button_tag ''my_object[my_param]'', "value" %> <%= file_field_tag "photo[uploaded_data]" %> <% end %> Now that I''ve typed this out I''m realizing that the facebook_form_for probably isn''t doing anything for me since i''m not using the f. helpers, but I have two models that I''m trying to save data for.nonetheless, here'...
2007 Mar 11
4
Faking it... import local files into attachment_fu
Hello, I''m working on an import utility that will match the functionality of uploading an object of a model that uses attachment_fu for thumbnailing, etc. Rather than uploading the file via a form, I want to populate the params[:image][:uploaded_data] with data from a file already on the server''s file system. So far, I''ve been able to copy to an instance of Tempfile via the copy_to_temp_file method I jacked from attachment_fu and pass that as the value of :uploaded_data, but attachment_fu is still not happy. The Tempfile cre...
2010 Apr 24
2
problem using attachment_fu with S3
...9;'150x150>'' } validates_as_attachment my view new <h1>New upload_file</h1> <%= error_messages_for :upload_file %> <% form_for(:upload_file, :url => upload_files_path, :html => { :multipart => true }) do |form| %> <p> <label for="uploaded_data">Upload a file:</label> <%= form.file_field :uploaded_data %> </p> <p> <%= submit_tag "Create" %> </p> <% end %> Thanks Attachments: http://www.ruby-forum.com/attachment/4689/20100420193040_create_upload_files.rb -- Poste...
2008 Jan 17
2
Inconsistent Model creation behavior
...grounDRb::MetaWorker set_worker_name :imagetest_worker def create(args = nil) end def save_image(args) @newbook = Book.new @newbook.comment = "hello" @newbook.save 14 @newerimage = Image.new 15 @newerimage.user_id = args[:user_id] 16 @newerimage.uploaded_data = args[:temppath] @newerimage.save end end ##################################################################################### It will create and save the Book object without problems. However, it will not create the Image object and instead I receive this error: #############...
2007 Dec 11
14
Attachment-fu + Story Runner
...ockFile.new "test_upload.txt", "Test Upload", "text/plain" to ''proper'' railsy stubs like: fdata = ActionController::TestUploadedFile.new("../spec/fixtures/ test_upload.txt", "text/plain") The actual params are specified as: { :uploaded_data => fdata, :filename => file_reference_name(identifier) } Now, this is being passed successfully into attachment-fu, where it is processed. Well, almost successfully. Somehow, along the way, the TestUploadedFile, struct, mock, whatever you want, gets turned into a String. Then i...
2012 Nov 12
1
undefined method `original_filename' for nil:NilClass
...eImporter.all.map {|importer| [importer.name, importer.id]}%>* * <%= f.inputs do%>* * <%= f.input :contact, :as => :select, :collection => Contact.all %>* * <%= f.input :route_import, :as => :select, :collection => RouteImporter.all %>* * <%= f.input :uploaded_data, :action => :status_race, :multipart => true, :as => :file %>* * <%end%>* * <input name=''commit'' type=''submit'' method=''post'' value=''Import''/>* *<%end%>* My controller: *collection_action :sta...
2008 Mar 20
0
Having trouble with a remote-crop-then-resize using attachment fu =(
...!@ UGH =( CONTROLLER: SCENE.RB # POST /yings # POST /yings.xml def create @ying = Ying.new(params[:ying]) scene = Scene.find(params[:ying][:scene_id]) scene.yings << @ying @ying.scale_to_scene(params[:ying], scene) avatar = Avatar.create!(:uploaded_data => params[:ying] [:uploaded_data], :content_type => ''image/png'', :filename=> "#{RAILS_ROOT}/public/images/avatars/yings/ #{@ying.id}_thing.png", :ying_id => self.id, :size => (@ying.width).to_i * (@ying.heig...
2007 Aug 14
2
AssociationTypeMismatch with RSpec 1.0.8, autotest running with drb
...alk this up as a bug and report it, I just want to make sure I''m not doing something silly. Running ZenTest''s autotest on OS 10.4.10 with RSpec 1.0.8, drb, produces the following failed test: ActiveRecord::AssociationTypeMismatch in ''User should create an avatar with uploaded_data'' Avatar expected, got Avatar This only happens with that exact configuration; turning off drb will fix it, as will running ''rake spec'' instead. I saw something like this in Brian''s post here [http://rubyforge.org/pipermail/rspec-devel/2007-June/003032.html] b...
2008 Feb 04
2
attachment_fu and form_tag for multiple models?
...ned for form_tag but am really hoping someone has a solution for this as frankly i''m stumped. here''s the form_tag part in the view... <% form_tag( { :action => "add_profile" }, { :multipart => true }) do %> <%= file_field_tag ''image'', :uploaded_data %> <%= text_area :profile, :body, :cols => 25, :rows => 6 %> <%= submit_tag ''Submit'' %> <% end -%> and in the add_profile method... def add_profile return unless request.post? @image = Image.new(params[:image]) @image.user_id = self.current_user.i...
2001 Apr 17
4
cannot allocate vector of size 71773 Kb (PR#915)
...on: R Version 1.2.2 (2001-02-26) Installed from the red hat RPM on your site on a Red Hat 7.0 i686 I get the following error when working with large data sets: > source("/usr/local/genex/rcluster/lib/rcluster/r/hcluster.r"); > breadth.program("uploaded_data.txt", "average", 10) Read 2 items Read 8574 items Error: cannot allocate vector of size 71773 Kb Execution halted Is there a way to fix this? This is running as part of the GeneX installation so I would have to dig thro...
2007 Aug 18
0
RSpec and acts_as_attachment
...is the equivalent Test::Unit case passes. Does anyone have any ideas? Best, Dave # it was a Test::Unit case first def test_should_be_invalid_without_file UserFile.any_instance.expects(:with_image).never assert_no_difference UserFile, :count do user_file = create_user_file :uploaded_data => nil assert user_file.errors.on(:filename) assert user_file.errors.on(:size) assert user_file.errors.on(:content_type) end end # Converting the above to the following spec it ''should be invalid without file'' do @user_file = create_user...
2010 Jul 11
0
Attachement_fu error when updating existing photos
...'' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb:23:in `full_filename'' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:369:in `temp_paths'' /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:354:in `uploaded_data='' My ruby code: <% form_for(@photo) do |f| %> <%= f.error_messages %> <%= image_tag(@photo.public_filename, :BORDER=>0) %> <p> <label for="upload">Upload new photo:</label> <%= f.file_field :uploaded_data %> <%=...
2007 Dec 31
2
episode 73 resulting in error: undefined method `stringify_keys!' for "33":String
...uot;=>"asdf"}, "27"=>{"title"=>"asdf"}, "30"=>{"title"=>"asdf"}}, "description"=>"3 year old german shepard lab mix. Test!"}, "id"=>"23", "picture"=>{"uploaded_data"=>""}} I noticed in the video, it shows the "picture_attributes" parameter as an array (not a hash is it shows on mine). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rail...
2007 Apr 27
3
attachment_fu content_type problem
Hi all.... Admittedly I''m new to Rails and trying to find my way but I''m having an issue with uploading documents with attachment_fu. I have a form where I''m uploading multiple attachments (using AJAX to add file_filed_tags). That seems to work pretty well. The problem is I can''t seem to get the content_type to work as I would expect. For example, if I use
2008 Oct 18
5
render :update / page.replace_html problem
Hi there, I have this ajax problem, I''m desparately trying to debug since 1 entire day now: The Controller includes: ======================== [...] render :update do |page| page.replace_html ''coverletter_part'', :partial => ''user/applicationfiles/coverletter_part'' end [...] The View includes: ================== [...] <div