search for: url_for_file_column

Displaying 20 results from an estimated 62 matches for "url_for_file_column".

2005 Oct 09
6
Problem With url_for_file_column/file_column
I am using the very helpful file_column extension in my app. The uploading portion works great - no problems. Where I am having an issue is displaying the images in my view. My code looks like this: <% for @record in @main_box_releases -%> <%= image_tag(url_for_file_column("record", "record_cover")) %> <% end -% @record is an instance of a class called Release. It is not nil, removing the url_for_file_column makes all errors go away and other calls to @record complete just fine. I get this error: cannot convert nil into String I'...
2006 Jan 25
1
url_for_file_column in parent model''s view
...books which has_many images. I was able to figure out how to enter the images into the correct model when updating of form of the parent model (books). Now I need to figure out how to view the images in simple display view of the parent model (books). I am not sure about the syntax of the url_for_file_column helper. Here is what I have so far: <% for image in @book.images %> <label for="image_name">Image:</label> <div class="reviewfield"><% url_for_file_column image, image.name, "thumb" %> </div><br /> <label for=&qu...
2006 May 08
1
file_column - url_for_file_column issue.
Hi, url_for_file_column @variable, ''name'', takes an instance variable. My question is, what if I don''t want to have to retrieve the instance variable every single time but I have the image id, along with its name with me. Could I contruct that object in a view and pass it to url_for_file_column...
2006 Jan 14
2
file_column, ActionMailer, and tests
...column called ''pdf''. I want to send out emails that contain the URL for the pdf file that''s associated with the Event. I also want to test the emails, so I''d need to be able to get at the URL for the pdf inside my unit tests. I don''t see how I can use url_for_file_column in this situation. Doing <%= url_for_file_column "event", "pdf" %> in the actionmailer doesn''t seem to work (I get a error when it tried to do nil.relative_url_root[1]). And I also don''t see how I can use url_for_file_column in my unit tests. Any idea...
2006 May 12
11
Stupid? question about if else logic
this seems so stupid, I keep thinking I''ve dealt with this before but I have this code <h1>Portraits</h1> <% if @image.portrait == 1 %> <%= image_tag(url_for_file_column ''image'', ''file'', ''thumb'') %> <% else %> <h1>Landscapes</h1> <%= image_tag(url_for_file_column ''image'', ''file'', ''thumb'') %> <% end %> where I want th...
2006 Mar 02
2
url_for_file_column not returning correct path
I added this test towards the end of the included file_column_helper_test.rb that shipped with the file_column plugin: def test_url_for_file_column_different_root_path Entry.file_column :image, :root_path => File.join(RAILS_ROOT, "public/files") e = Entry.new(:image => upload(f("skanthak.png"))) assert_match %r{/public/files/entry/image}, e.image_options[:store_dir] assert e.save assert_match %r{fi...
2007 Dec 29
1
url_for_file_column not works
I am using the file column plugin. If i upload an image it works correctly but if i want to show an image it not works. in my template i insert url_for_file_column(@core, "image", "thumb") but return "" i tried to print @core.image but it is set to nil. My model is this: class Core < ActiveRecord::Base has_one :forum_topic has_many :votes has_many :forum_messages ,:through => :forum_topic attr_accessible :site,:...
2006 May 12
3
file_column error
Hmm, I''m using file_column and going by this tutorial, the files upload ok and I can see the fields updated in the database, but I am getting this error: "Trying to access file_column, but primary key got lost." Thanks in advance -- Posted via http://www.ruby-forum.com/.
2006 Jan 19
1
partials and instance variables for file_column
Hi, Sebastian Kanthak of the file_column-Plugin wrote once: "is the photo object inside a local variable or an instance variable (e.g. photo or @photo)? url_for_file_column only works with instance variables, like all other active record form helpers. Could this be the problem?" So I''m using file_column in a partial, e.g. <%= render (:partial => "product", :collection => @products) %> my partial (_product.rhtml) looks like this:...
2006 Jan 17
5
file_column mangling URL
Hey, I''ve gotten file_column to upload a file, drop it in the dynamic directory, but I can''t display the image, the directories repeat themselves: My model: class Person < ActiveRecord::Base file_column :image_url In my view: <%= image_tag url_for_file_column(''person'', ''image_url'') %> HTML generated is this: <img alt="Male_face" src="/dhcp/public/dhcp/public/person/image_url/3/male_face.jpg" /> There shouldn''t be two ''/dhcp/public'' there. -- - Nic
2005 Oct 04
3
[Q] file_column help needed
Hi all, I''m trying to use file_column to upload a picture but I''m getting the following error: "cannot convert nil into String" caused by the last line in FileColumnHelper::url_for_file_column(object_name, method) url << object.send("#{method}_relative_path") I don''t have any images uploaded for existing entries so does this not work when images are missing? Or what am I missing? Thanks, Brent __________________________________ Yahoo! Mail - PC...
2006 May 30
0
url_for_file_column and image_tag not working right together
i just got file_column working and i love it. but i''m having some problems with the urls. my application is not in the base directory, it is in a folder called "/testapp". when i use "image_tag" with "url_for_file_column", i get this path: /testapp/testapp/entry/image/3/myimage.jpg the image is located at: /testapp/entry/image/3/myimage.jpg to see if it was my file_upload making the wrong urls, i tried something like: <%= link_to ''Image'', url_for_file_column... the links work perfec...
2006 Feb 10
2
file column within link_to
Hi, I correctly see: image_tag url_for_file_column("element", "picture_url", "medium") now I need to make it a link so I''ve used: <%= link_to(image_tag url_for_file_column("element", "picture_url", "medium"), {:controller => "products", :action => "sec_leve...
2006 Jan 08
0
link_to_remote(image_url url_for_file_column(product, "image
I apologise for bad formatting. I don''t know how to make it nice in an email How do you nest image_url tags into link_to_remote tags. The following creates the error:wrong number of arguments (3 for 2) <%= link_to_remote(image_tag url_for_file_column(product, "image_url"), { "class" => "small_product", "onMouseOver" => "this.className = ''product_hover''", "onMouseOut" => "this.clas...
2005 Dec 17
1
file_column url_for_file_column from within controler
Hello, i hope somebody can help me: How can i get the path/url for a file stored with file_column within any contoller? Is it somehow possible to use the url_for_file_column method from the file_column_helper.rb ? Greetings and thanx for any advise, Marc -- Posted via http://www.ruby-forum.com/.
2007 Aug 18
1
problem with file_column url generator
Hi, I have the following in a viewer Here, @lst = Homework.find(:all) is an array of homeworks. I checked this this is correct. Based on the error below, somehow, the url_for_file_colum does not like to act on the model element. I checked the source code to url_for_file_column, and the problem is with instance_variable_get(). I have no idea wat is going on! Any help is appreciated. Gordon. ---------------- <% @lst.each do |hwk| %> <p> <%= link_to File.basename(hwk.file_name), url_for_file_column(hwk, "file_name") %> </p> <...
2008 Sep 15
1
url_for_file_column within if within a partial
I have a partial that has the following code: <% if product.prd_big_image.nil? %> <img alt="Image" src="/images/empty.jpg"> <% else %> <%= image_tag url_for_file_column(:product, :prd_big_image, "normal") %> <% end %> and get the following error You have a nil object when you didn''t expect it! The error occurred while evaluating nil.prd_big_image_relative_path If I run the code in a normal html.erb (not a partial) it works fine, just...
2006 Jan 17
2
file_column plugin and instance variables
To make file_column work I have to copy my local variable back to an instance variables like this: <% for product in @products @product = product %> <div class="catalogentry"> <%= image_tag url_for_file_column(''product'', ''image_url'') %></p> This is needed because file_column specifically looks for the instance version of the variable. def url_for_file_column(object, method, subdir=nil) case object when String, Symbol object = instance_variabl...
2005 Aug 17
7
(newbie) #{method}_relative_path empty (file upload 0.1.2)
...g this module... I''ve been spending a lot of time in getting file uploads to work. inside a project I''m working on, I''ve got two different models using it... with one of them it''s working just fine. with another, everything works, with the exception of the url_for_file_column helper, which shows /entry/file_column/ but not the relative path (/ entry_id/file_name), so it writes this: /photo/file// looks like file_relative_path isn''t returning the path, though there''s a file name written to a ''file'' column in the database table....
2006 Aug 13
5
problems with file_column plugin
1) installation is not as smooth as some other plug-ins. If you follow the instructions on http://www.kanthak.net/opensource/file_column/ it makes a directory called trunk instead of file_column. You have to manually rename it to file_column. I guess this is a minor annoyance but it gives me the feeling that things aren''t quite like other plugins. 2) I get this error: undefined