Displaying 20 results from an estimated 300 matches similar to: "Dynamic file paths in FileColumn"
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>
2005 Dec 29
3
FileColumn Help
i''ve changed store_dir to :store_dir => "public/uploads/users/pictures/"
that works great for uploading, but url_for_file_column is still
outputting:
/user_picture/image/id/name.jpg
how do i make url_for_file_column output the correct url?
--
Posted via http://www.ruby-forum.com/.
2006 May 19
1
FileColumn
I''m using Windows and Postgres 8.
I installed RMagic gem thingy and FileColumn plugin ok.
I followed instructions exactly as directed on FileColumn web site which
is very straight forward:
---model
class My_model < ActiveRecord::Base
file_column :column_for_file_name
end
-----view -upload form--set to mulitpart
<%= file_column_field "my_model",
2006 Apr 05
0
FileColumn - version and not image files
Hi
I have this filecolumn:
file_column :file, :magick => { :versions => { :large => ''756x567>'' } }
Does anybody have a solution to make this also accept files that aren''t
images? Now this makes filecolumn return an error of "File invalid
image" if the file isn''t an image.
Would be nice if it, when the file is invalid image, just
2005 Dec 27
1
filecolumn to database
Hi,
I''m using filecolumn to upload a file to mysql blob :
_form.rhtml : file_column_field "entry", "attach"
model (rb file) : file_column :attach
How can I update controller create function to insert file in database ?
redefine model save function ? Someone has a sample source ?
Regards,
Fabian
2006 Mar 30
0
FileColumn Redux
I installed FileColumn successfully but now find the need to get a new
image size.
I was wondering if there was a fast script, or method, that would run
through all my products and use the existing mail file already submited
and resize it according to the new specifications.
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Mar 20
1
FileColumn question
Can someone please help me with this.
I have an Images table :-
create table images (
id integer unsigned not null auto_increment primary key,
image varchar(200) not null default ''''
)ENGINE=InnoDB default CHARSET=latin1;
And a car table :-
create table cars (
id integer unsigned not null auto_increment primary key,
user_id integer unsigned not null,
title varchar(100) not
2005 Dec 04
2
Filecolumn: url_for_file_column problem
Calling url_for_file_colum results in a TypeError: can''t convert nil to string.
The error is in line 148 of filecolumn.rb:
def relative_path(subdir=nil)
File.join(relative_path_prefix,subdir, @filename)
end
If I substitute '''' for subdir in the File.join command, then it seems to work fine. Since this is a plugin, I''m wondering why I need
2006 Dec 08
2
trouble using ActiveRecord classes
I''ve been trying unsuccessfully for the better part of today to write a
worker that can use by ActiveRecord model classes.
The bizarre thing is that worker just stops at the point accessing the
database connection. An exception isn''t raising, it just dies.
My worker class is below, I''ve interspersed log messages throughout to try
to determine where it is dying.
=====
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]
2008 Jan 18
2
has_many :through with self-referencial AND polymorphism
Hello, despite many readings I still don''t understand how to solve my
problem.
I have Publication, Picture, File classes
A Publication can be related (a one way relation, like a www link) with
another Publication, Picture or File
I tried this :
Publication :
has_many :related_elements, :dependent => :destroy, :foreign_key =>
:publication_id
has_many :related, :through =>
2007 May 22
2
find :all :include broken on Oracle 10
Hi,
I am trying the following in Ruby using InstantRails 1.7 on WindowsXP
Publication.find(:all, :include => [:doc_type, :release_state] )
but I get the error:
OCIError: ORA-00904: "DOC_TYPES"."PUBLICATION_ID": invalid identifier:
SELECT publications.id AS t0_r0, publications.docid AS t0_r1,
publications.doc_type_id AS t0_r2, publications.title AS t0_r3,
2007 Feb 07
0
strange sqlite3 errors - validates_associated & failing activerecord unit tests
I''m getting two strange errors, both which I believe relate to sqlite3.
The first one is with validates associated. Here is my test:
require File.dirname(__FILE__) + ''/../test_helper''
class SubscriptionPlanTest < Test::Unit::TestCase
fixtures :subscription_plans
fixtures :publications
def setup
@six_month_gold = subscription_plans(:six_month_gold)
2006 Jun 05
1
file_column permissions
this is getting frustrating...
i installed file_column without a hitch for the first time to just play
around with. using the exact same steps as before, i try to use it with
one of my actual applications, and i get "permission denied" errors. i
figure there might be some conflict with my application so just for
kicks i do the exact same thing i did the first time to test
2009 May 25
0
NameError (uninitialized constant FileColumn::Magick::ImageList
Hi,
I have been using RMagick and File Column in my app together without a
problem, but when I tried to add in some new functionality in my model
where I use file_column, I got the error in the subject line. The
offending line in my code is:
image = Magick::ImageList.new(path_to_image)
Has anybody ever seen this problem when using the two libraries
together? I have tried adding in a require
2006 May 15
5
Finding out the file attributes in FileColumn models
Is there a way to find out the attributes that have been passed to
file_column in models? I''ve looked through the source and it seems that the
file_column methods are generated at runtime but there''s actually no class
or instance variable that hold the file attribute.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jul 30
1
FileColumn - Validate Before Saving
file_column is great -- but I need a way to run through the validations
(ie: validates_file_format_of) before saving. That is, when a user first
uploads an image it is displayed in the view but not ''saved'' until they
click the ''Save'' button on the form. I want to display an error
message/disable the ''Save'' button if the file they just
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 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 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