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 simply the filename.
Is this a bug in the plugin or am I not using it properly?

Thanks in advance,
Cagan

Can you get it working when the image is inside the rails root? I’ve
never used the plugin (yet), but my guess is that this could be a good
indicator whether you’ve been doing something wrong or the plugin just
can’t handle images being stored anywhere else.
-Nathan

unknown wrote:

Can you get it working when the image is inside the rails root? I’ve
never used the plugin (yet), but my guess is that this could be a good
indicator whether you’ve been doing something wrong or the plugin just
can’t handle images being stored anywhere else.
-Nathan

Hi Nathan,
yes it works when the image is inside the rails root.
Thanks,
Cagan

Andrew S. wrote:

I have no problems in storing the files by setting :root_path option.

I had a similar issue using the :store_dir. I updated the
url_for_file_column method to use the :store_dir option defined in the
class. I sent it to the author of file_plugin as well as posting the
modification to:

http://wiki.rubyonrails.com/rails/pages/HowToUseFileColumn

You’ll need to modify this further to use the :root_path setting.

It may not be the ideal fix, but found that it worked for what I needed.

I commented out the original method and replaced it with your method in
file_method_helper.rb.
I get a ‘NoMethodError undefined method `/opt/wwz/user/image_path’ for
#User:0x22df05c
on the following line:
return object.send(options[:store_dir]) << relative_path

I have no problems in storing the files by setting :root_path option.

I had a similar issue using the :store_dir. I updated the
url_for_file_column method to use the :store_dir option defined in the
class. I sent it to the author of file_plugin as well as posting the
modification to:

http://wiki.rubyonrails.com/rails/pages/HowToUseFileColumn

You’ll need to modify this further to use the :root_path setting.

It may not be the ideal fix, but found that it worked for what I needed.

just use a symbolic link inside rails…

cagan senturk schrieb:

Pete wrote:

just use a symbolic link inside rails…

cagan senturk schrieb:

yes that’s exactly what I ended up doing at the end…
Thanks,
Cagan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs