Displaying 2 results from an estimated 2 matches for "field_options".
2006 Jan 09
7
File_column Dynamic directory
...stood 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
File.join(field_options[:root_path], "picture",@user.username,
"image")
end
When I run the app I recieve the following error:
undefined method `to_str'' for :dynamic_dir:Symbol
This is the code that Kyle sent me in reply to my original question:
class Model #...
file_column :field,...
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