Displaying 20 results from an estimated 30000 matches similar to: "Help with file_field"
2010 Oct 27
4
Using ActiveRecord 3.0.x with Ruby 1.9.2
Can someone remind me of the incantation to use ActiveRecord in a
plain ruby program for the versions specified. I''m not having any luck
searching with google and I keep getting:
`require'': no such file to load -- activerecord (LoadError)
Not sure if this is a dependency or file path problem.
Thanks
--
You received this message because you are subscribed to the Google
2011 Sep 10
4
Finding HTML attributes with jQuery in Rails 3.1
I''m having trouble wrapping my head around the proper syntax to have
jQuery (in an .js file) grab an HTML attribute and use the value of
that attribute to load a partial.
HTML fragment:
<a href="/toggle" data-remote="true" section="training">
jQuery string (now setting a static partial, I need this to be
dynamic)
2006 Jul 28
1
How do I get an original file name from an upload using file_field?
I am uploading a .csv file for importing into a database; however, this file
does not need to be saved on the server. How do I get the file name of the
original file? I know about the file_column plugin but I don''t need/want to
save the uploaded file on the server, I just need to import it and delete
it. Right now the file name get returned as some random temp file name...
there has to be
2010 Sep 20
0
file_field
At: http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm
You can find:
<%= file_field ''upload'', ''datafile'' %>
I saw the file_field documentation from here:
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-file_field
But, still cannot get how the parameters ''upload'' and
2010 Jul 04
2
DRYing Routes
I have a series of ''static'' pages for a site that need named routes in
Rails 3. I''m trying to DRY the routes file, but can''t seem to find the
proper code.
The desired output/code is:
match ''/about'' => ''info#about'', :as => :about
for each page. My attempt to dry this:
%w(about services articles marketing clients).each
2010 Nov 04
1
Calling a method directly from a test => no method error
I''m trying to get a test to pass and keep getting a "no method error"
I''m using the routines from Chapter 8 of "Security on Rails" and can''t
get the test to pass. I keep getting "no method error" for decrypt.
Can someone help me with the correct "address" for decrypt so I can
call it directly.
Here is the routine definition:
2006 Jan 22
1
file_field questions
A couple questions about file_field elements.
First, with code such as this:
<%= file_field ''attachments'', ''filename'' %>
Would the filename of the file I select be the value that''s stored
within the database under the "filename" column, and then I would just
add in code in my "create" controller to upload the actual file?
2006 Jan 15
4
file_field vs. file_field_tag
Hi,
The documentation doesn''t make it clear why both file_field and
file_field_tag are both useful. What is the reason for having two
instead of just one of these?
Thanks,
Peter
2006 Feb 06
2
File_field and Firefox
Hi!
Im developing a simple prototype of an application. It fills an oracle
db with data about a file in the filesystem, and save the entire file
in a blob along with some metadata. To get the file in the db i use a
file_field form helper. All goes well with the radrails-integrated
browser, but it doesnt work anymore in firefox. The problem is,
firefox seems to cut the pathname from the file.
Here
2009 Feb 11
0
remote_form_for file_field strangeness
Does anyone see any problem with this form?
- form_remote_for(Photo.new, :html => {:multipart => true, :target
=> :uploader}) do |f|
.form_element
= f.label :photo
= f.file_field :collateral
= hidden_field_tag :container_id, @shoot.id
= hidden_field_tag :container_type, @shoot.class.name
.form_element
= f.submit ''Add Photos''
The photo has a
2005 Nov 17
1
original filename doesn't display in file_field
In my item upload view I have:
<%= file_field ''item'', ''file'' %>
and in my Item model:
def file
@file
#@file.original_filename # <- also tried this
end
def file=(file)
@file=file
end
And if the upload bails because of errors (and renders the same page), all other fields
(text_field, text_area, etc.) retain their inputted values, but the file
2006 Jul 18
0
how to ensure that a file has been selected on a file_field?
Does anyone know how to validate if a file has been selected using a
file_field control?
I want to ensure a file has been selected before the associated action
is selected.
Presumably something like validates_presence_of something ?
Any pointers most appreciated...
John
--
Posted via http://www.ruby-forum.com/.
2006 Apr 30
0
ActionMAiler and file_field Question
Hi Gang,
I''m trying to figure a way to set an attachment to an email by allowing
the user to browse for a file to send with the mail. I thought that I
could use file_field to do this - but having no luck. HAs anybody got a
working example of how to achieve this? Or is it the wrong way to go?
TIA,
Eric.
2008 Jun 19
2
Non editable file_field
Hi,
I need to upload files in my application
I am using following code
<tr>
<td width="125">Upload Document:</td><td width="400"><%=
form.file_field("filename") %></td>
</tr>
But I want that the file field that gets displayed in my browser should
not be editable.
i.e user should be able to select the file through the
2009 Oct 20
5
Annoying problem with file_field and paperclip
Hi all,
I have a really really annoying problem that''s driving me nuts with
file_field and paperclip and having to upload images everytime a form is
edited even though the user is quite happy with the currently uploaded
image or loose the previously uploaded image.
This seems to be caused by the rails file_field helper not storing the
data that has been read in from the db in the same
2006 Aug 15
8
AGAIN: file object treated as string
I am trying to implement the uploading of a file to a remote server
I get error while trying to write the file on the server. The error I
get is the following:
undefined method `rewind'' for #<String:0x2aaaad062eb8>
It seems to be treating my file as a string instead of a File object.
--------- Code is below ------------------
VIEW:
<%=
2007 Mar 14
9
file_field doesnt work inside form_remote_for
When I do file_field within a form_for things are fine... but within a
form_remote_for, with nothing else changed, I find that the params
does not even have the element document[uploaded_file] even though it
is definitely present in the HTML source in the form. Obviously the
file upload fails.
Am I missing something? Or has someone else faced this? Or is this a
known bug?
Rajesh
2006 Aug 15
0
file object treated as a string
I am trying to implement the uploading of a file to a remote server
My upload form looks like this:
<%= start_form_tag(:action => "save_image", :multipart => true) %>
<td><b>Description</b> </td>
<td><%= text_area("image", "descript", "cols" => 33, "rows" => 5) %></td>
2006 Jul 26
5
code for uploading files to the filesystem instead of db
Does anyone have any standard code for uploading files to the
filesystem?
I''ve got code already for uploading images to the database but I''d
prefer to store the files on the filesystem.
In particular I need to know how to
(a) ensure a file has been selected in the file_field
(b) how to extract the filename from the file_field
(c) how to actually move the file from client to
2011 Jul 07
0
Question of uploading large file using carrierwave, uploadify and nginx upload module
Hey ROR users,
I have a small experimental web app which is for uploading files. The
web app uses carrierwave, uploadify. It works fine on small size
files. However, it can not handle large size files (>1G) efficiently.
Then I decided using nginx upload module, it worked well on small size
files after modification of codes,. But It fails on uploading large
files (>1G) because of http error