similar to: file_column plugin. Storing files outside RAILS_ROOT

Displaying 20 results from an estimated 500 matches similar to: "file_column plugin. Storing files outside RAILS_ROOT"

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},
2006 Jun 14
3
where to define a struct
Hello, I''m trying to use the following Struct in my web app: UserInfo = Struct.new( "UserInfo", :first_name, :last_name, :email, :domain_name ) I placed this in the environment.rb, thinking that it should be initialized only once. But when I try to access it from within my controller, I get: undefined method `UserInfo'' for #<UserController:0x243ad5c>. so
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 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
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
2006 Jan 17
3
file_column :root_path question.
I''m developing on Windows and deploying to FreeBSD+lighttpd using Switchtower and I''ve got things generally working. My problem now is that file_column data gets zapped every time I deploy, because Switchtower creates a whole new myapp/public directory with each rev. I looked through the file_column docs and found the :root_path option, which I use in my models as follows:
2006 Mar 23
5
Filecolumn storage location
Hi, I am using file_column for some image uploading. I want to have all the images stored under one root which I have managed by setting the :store_dir option as below. file_column :filename, :store_dir => File.join(RAILS_ROOT, ''public'', ''images'', ''products'') So, my images get uploaded to: /public/images/products/<primary_key>
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
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
2006 Mar 16
2
Questions about file_column plugin
Hi! I''ve got 2 models - let''s call them User and Image. User has_many images. (Thanks to Mark Reginal James :) ) I have a single form where i can create a user and add to him any number of images, which are uploaded using file_column plugin. Now 3 questions: 1. How to change the default path where file_column plugin saves images, so it will save them in a directory, which
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:
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 Mar 02
17
can''t get rails to connect to mySQL - HELP!!!!!!!!!
Sorry, but this is really NOT as easy as the tutorials/books make out. I''m really struggling at the first hurdle here. And while I''m not a programmer by design I do know my way around most stuff. And if I can''t get this to work I suspect more people will have the same issues. There seems to be too many variables to address. I have winXP, I have ruby and rails 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 Jan 22
12
Problems with File_column
Hi, Rails - newbie here.. I''m setting up an app and am trying to use file_column to upload a picture with an item and I''m running into several problems. (Background: I''m running Locomotive Rails under OS X 10.4.4, and using Safari) I followed the directions to add the necessary items, then found out that I had to add the item to make the form tag be a multipart
2006 Jan 17
0
file_column with both root_path and store_dir
I store my file_column database outside of my RAILS_ROOT. It seems to work in real life, but not in tests. In the tests, I can''t set both the root_path and the store_dir. In tests, setting the store_dir option will override the root_path option. The only way for root_path to work is to remove store_dir. I think the problem is in file_column.rb on line 22: options[:store_dir]
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 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
2008 May 21
3
How to access Rails::Configuration instance methods
There was a thread yesterday about ENV["_"] which is not available to Windows, I got to playing around with how to find access to the initializer_path or in this case the root_path My question is more about why I don''t have access to what appears to be a public method than finding the root_path. I did this in 2.0.2 with script/console The Rails object has a Configuration
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