Displaying 20 results from an estimated 2000 matches similar to: "Questions about file_column plugin"
2006 Jan 04
4
file_column
I use file_column and it works fine.
I tried to change the store_dir to a the path I want my files to be
stored and not the default.
I stored some images fine. But when I try to reach my images it seems
like file_column uses the model_name/attribute_name on the image and not
the store_dir I used. How can I change this ?
Thanks in advance
--
Alexander Antonakakis
2006 Jan 09
7
File_column Dynamic directory
I asked this question earlier and did recieve an answer but I am not
sure Ifully understood the answer as I am getting all sorts of
errors when trying to implement.
Basically I want to add a layer to the path for my files. I have the
following set up in my model class:
file_column :image,
:store_dir => :dynamic_dir
def dynamic_dir
2006 Jun 28
6
file_column plugin. Storing files outside RAILS_ROOT
I also posted this on Rails Engines forum. Sorry for the double post.
I am trying to configure file_column plugin so that it stores the images
in a directory completely outside of RAILS_ROOT.
I have no problems in storing the files by setting :root_path option.
But I can''t get to display these images using ''url_for_file_column''.
What I get instead of the image is
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},
2005 Dec 20
3
File Column Directory Add another layer
Quick Question. I understand how to change the default path to
something other than public but what if I wanted to add another
directory into the equation. I want to upload an image into the
following structure:
/public/image/userid/imageid/test.gif
So basically I want to look up the userid in my users table and put
all the images for that user in the same directory. So i have a one
2005 Nov 18
10
[Request] file_column configurability
I wasn''t sure where to email this request, so I am hoping the author of
file_column actually sees this. I was wondering if there were any plans to
allow some configurability in the file_column plugin. By configurability I
mean allowing the developer to define which table column is used as the
unique identifier when creating image folders. Right now it seems like it
uses the ID of the
2005 Dec 23
6
file_column and HABTM
I have several models that will be using file_column by way of the
"Picture" class (HABTM). Right now, all pictures are stored in:
public/picture/image/1/filename1.jpg
public/picture/image/2/filename2.jpg
Is there a way I can dynamically define the "store_dir" based on the
model? For example, if I have "user", "product" and "place" models all
2006 Apr 14
1
file_column and custom store_dir
I''m using file_column to store mulitple versions of an image in a custom directory "images/artwork/" with the :store_dir option.
This is working fine for uploading and storing the images, but whenever I try and access the images with the url_for_file_column helper it keeps generating the default path. I thought it would replace this by default, but it doesn''t seem to.
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 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
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
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",
2006 Jan 14
2
file_column, ActionMailer, and tests
Hi,
Say I have a model Event that has a file_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 <%=
2006 Jul 03
1
staying in control over the case in file_column plugin
using file_column plugin, if I upload IMG0001.JPG, I get files similarly
named IMG0001-thumb.JPG, etc. but if I upload img00002.jpg, I get files
img00002-thumb.jpg, etc.
This is tacky in terms of my counting on a consistency when implementing
views.
My inclination is to start hacking away at this section of
file_column.rb:
class PermanentUploadedFile < RealUploadedFile # :nodoc:
def
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
2006 Apr 14
5
state_models plugin and file_column?
I was looking at Kyle Mawell''s extremely nifty-looking StateModels
plugin
http://www.kylemaxwell.com/articles/2006/02/06/fun-with-single-table-inheritance
and before I go down the road with it, I was wondering if anyone has
used it with file_column.
The way file_column deals with an uploaded file -- by storing it to the
filesystem in a path that employs the model name and id --
2006 Mar 02
2
How to get mime extension with file_column
Is there a way to get the MIME extension of a file_column field?
Here''s what I want to do (look for comment in before_save method):
class ProductFile < ActiveRecord::Base
belongs_to :product
file_column :file_name
def before_save
self.file_type = # something that returns the MIME type (e.g. image/jpeg)
end
end
TIA
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
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
2006 Jan 16
6
file_column plugin error
Hi,
I downloaded FileColumn plugin and love the concept.
But when I tried the example listed on the plugin web
site, I got the following
error:
NoMethodError in Entry#new
undefined method `file_column'' for Entry:Class
My environement is Red Hat linux 9.0 with mysql 4.1. I
installed file_column under vendor/plugins. If I run
"ls", I get the following directories: