search for: upload_field

Displaying 2 results from an estimated 2 matches for "upload_field".

2006 Feb 06
2
File_field and Firefox
...ory - contrattositoweb.pdf The important part of the code is, for the view: <p><label for="document_data">Content</label><br/> <%= file_field ''document'', ''upload'' %></p> and in the model document.rb: def upload=(upload_field) self.filename=upload_field self.content_type=MIME::Types.type_for(upload_field) File.open(upload_field, "rb") { |f| #ERROR HERE self.filename=File.basename(upload_field) self.content=f.read } end def base_part_of(file_name) na...
2009 Mar 07
0
RJS: pass javascript variables in ruby calls
Hey, I have this link_to_function which takes an RJS block as follows: page.insert_html :bottom, :documents, :partial => "upload_fields", :locals => { :doc => Document.new, :index => ''UNIQUE_ID'' } It adds a partial to a div. I need index to be a unique id, but can''t generate one. I have an actual javascript function next_index() that will return the next index that works. Is there any w...