similar to: How to retrieve a FileBlob from 'ActionDispatch::Http::UploadedFile' instance?

Displaying 20 results from an estimated 700 matches similar to: "How to retrieve a FileBlob from 'ActionDispatch::Http::UploadedFile' instance?"

2013 Mar 22
0
Should to_io be added to ActionDispatch::Http::UploadedFile?
In rest-client/rest-client#144<https://github.com/rest-client/rest-client/issues/144#issuecomment-14876580> we''re trying to handle objects that behave like IO. Some have suggested that respond_to?(:read) is a poor test of this and have suggested using IO.try_covert(obj) instead. My counter example for this is ActionDispatch::Http::UploadedFile. I''m wondering if there
2011 Aug 31
5
3.1rc8 - posting files in a test no longer works
A previously working test, that posted a file object no longer works in the latest 3.1. The test looks like this: params[:media][:new_attachment] = File.open("#{Rails.root}/test/data/ less_than_100.png") post :create, params In the controller, I obviously expect params[:media][:new_attachment] to be a File object - and it used to be. Now it looks like #inspect has been called on the
2011 Mar 11
12
A file-upload suddenly seems to be nil
Hi there, I posted this issue <https://groups.google.com/forum/?hl=de#!topic/carrierwave/ergk9LaO68k>at the carrierwave-group, but I''m beginning to think this rather is a rails-issue than a problem with carrierwave. The problem''s this: I have 2 models, ''article'' and ''upload''. article has_many :uploads. In my article_controller i
2011 May 16
2
Cannot get multipart => true , running well in my form when using remote => true
I have a simple form , with a file field = form_for (Clip.new), :html => {:multipart => true} , :remote => true , do |f| = f.hidden_field :user_id, {:value => current_user.id} = f.text_field :name = f.text_area :description = f.file_field :image = f.submit I18n.t(:add) generating the html code <form accept-charset="UTF-8"
2013 Jun 22
4
ActiveRecord::Base.transaction - SystemStackError - stack level too deep:
Im having an issue that seems to only happen when trying to use a transaction. Ive used transactions many times in the past and Im at a loss as to why im getting the stack level too deep problem. SystemStackError - stack level too deep: actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:70:in `'' I have a StackOveflow with more detail -
2010 Aug 13
5
"uninitialized constant" Error for CalendarHelpper
After installing calendar_helper-0.2.3 gem, application using CalendarHelper works fine. Then I tried to test using rake command which gave me the following error. Why does these messages appear evenif the application owrks fine. ------------------------------ Error Messags -------------------------------------- /usr/local/jruby-1.5.1/bin/jruby -I"lib:test"
2010 Nov 19
1
Help: delegated association 'App' returning ActionDispatch::Integration::Session instead
class Foo < ActiveRecord::Base has_one :bar delegate :app, :to => :bar end class Bar < ActiveRecord::Base belongs_to :app def self.attribute_column_names return @@attr_columns if defined?(@@attr_columns) readers = content_columns.map { |n| n.name.intern } - [:created_at,:updated_at] @@attr_columns ||= readers.map { |k| [k, "#{k}=".to_sym] }.flatten end
2012 Jun 08
1
[Rails 3.2.5] Rails: unit test fixture_path : fixture_file_upload cannot find the file ...
I am trying to perform a test unit, using FactoryGirl include ActionDispatch::TestProcess FactoryGirl.define do factory :article do ....... photo { fixture_file_upload ''/files/test.jpg'', ''image/jpg'' } end end IN mt test_helper.rb I defined the fixture_path def fixture_path File.dirname(__FILE__) + "/fixtures/" #
2011 Jan 10
0
Can't use ActionDispatch::Request in Rails middleware because path_parameters get lost
Hi, I just encountered a bit of an issue where we call request.params of an ActionDispatch::Request inside a rack middleware right before a Rails 3.0.3 app. The issue is that the path_parameters never appear in the parameters hash if you call request.params before the rails app. It seems that that the requests.params method memoizes itself in "action_dispatch.request.parameters"
2010 Jun 12
0
[PATCH] ActionDispatch MemCacheStore violates encapsulation principle
When pass :cache param to ActionDispatch::Session::MemCacheStore, it should be removed from options, otherwise it remains "published". This violates the OOP encapsulation principle. I created a LH ticket with a patch http://bit.ly/cGDaWs Luca -- lucaguidi.com twitter.com/jodosha -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2011 Jul 31
2
Looks like an error in docs for ActionDispatch::Routing::Mapper::Resources
Please take a look at this page: http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resource It reads: :path Set a path prefix for this resource. resources :posts, :path => "admin" All actions for this resource will now be at /admin/posts. For me (Rails 3.0.9) it routes to just "/admin", not "/admin/posts".
2009 May 11
7
Upload file with url parameter
I want to upload file using get method. for example, "http://www.mydomain.com/upload?file=c:\test.exe" upload my local file to the remote server. I found one useful link about file uploading here(http:// www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm). Even I''ve changed some code in order to fit my rails version, it worked well. But the problem is I have use
2011 Mar 02
2
Rails3 Uploading a File over AJAX
What is the Rails Way of uploading a file over AJAX with Rails 3? In previous versions of Rails, I''ve posted to a targeted iframe and used responds_to_parent to render the response. This doesn''t appear to be working with Rails 3. Anyone know a better solution? Thanks! Tom -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Jan 05
4
testing file uploads
Hi all, I was wondering about the class used when rails receives file uploads. Sometimes it appears to be a File, and other times it is a StringIO. Also it has methods such as original_filename that don''t appear to belong to either of these classes. I ask because I''m trying to work out how to test my fil upload related models and controllers. Is there some standardised way of
2011 May 17
2
Can't dump File ... when uploading files
I am getting this error on the redirect_to command ... I am using Rails 3 w Paperclip to upload files ( but I tried also CarrierWave .. same error) I tried to change the session store from cookie-based to database .. same error I tried to delete the params content ... I don''t know what to try next .. any clue ? thanks erwin -- You received this message because you are subscribed to
2010 Dec 20
2
The Rails3 way for in-place editing
Currently I want to implement in-place editing directly on the index-page (for the sake of learning just xx products with a name to be edited). These are my favorite links from yesterday''s research (for the archives): *On the spot is a Rails3 compliant unobtrusive javascript in-place-editing plugin: http://rubygems.org/gems/on_the_spot
2011 Jul 14
0
Converting an Uploaded File to a string while maintaining binary data
Ok so it boils down to this I uploaded a picture into a ActionDispatch::Http::UploadedFile and want to convert it to a string before I send it off google storage. When I do this it complains about having null characters. I had the same problem when I was experimenting with files from my hard drive with the same function. I was able to do it with: File.open( ''filename'',
2013 Sep 30
0
TypeError: no implicit conversion of Symbol into Hash when submitting form to upload files
I''m currently new to Rails and Ruby and I''m trying to learn from my mistakes, this time I''m trying to upload 2 files from a form for later processing, however, after I hit the "Submit" button. I keep getting this error: TypeError in UploadFilesController#create app/controllers/upload_files_controller.rb:28:in `new''
2009 Mar 28
1
Image uploading - upload_column
Hai I am using upload_column for uploading images. Trying to do the user registration. For the first time when the user tries to upload image it works fine. But when try to update the image an error undefined method `process!'' for #<UploadColumn::UploadedFile:0x6838424> occurs. in my view I set the :multipart=>true. and in controller in the edit action @user =
2010 Mar 13
1
Testing file upload (Sinatra, RSpec, Rack-Test)
Hi. I have a simple application and I want to add a file upload functionality. How can I write a spec? Here''s my try. # directory structure app: - controller.rb - controller.spec.rb - files: [] - fixtures: [test_file.png] # controller.spec.rb require ''rack/test'' require ''controller'' module MyHelpers def app Sinatra::Application end end