cagan senturk
2006-Jun-28 18:31 UTC
[Rails] 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 -- Posted via http://www.ruby-forum.com/.
njmacinnes@gmail.com
2006-Jun-28 18:47 UTC
[Rails] file_column plugin. Storing files outside RAILS_ROOT
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 On 28/06/06, cagan senturk <cs327@teknolabs.com> wrote:> 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 > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
cagan senturk
2006-Jun-28 18:52 UTC
[Rails] Re: file_column plugin. Storing files outside RAILS_ROOT
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. > -NathanHi Nathan, yes it works when the image is inside the rails root. Thanks, Cagan -- Posted via http://www.ruby-forum.com/.
Andrew Stone
2006-Jun-28 18:56 UTC
[Rails] file_column plugin. Storing files outside RAILS_ROOT
> > > 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. -- Andrew Stone -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060628/3b276767/attachment.html
cagan senturk
2006-Jun-28 19:11 UTC
[Rails] Re: file_column plugin. Storing files outside RAILS_ROOT
Andrew Stone 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 -- Posted via http://www.ruby-forum.com/.
Pete
2006-Jun-28 19:56 UTC
[Rails] Re: file_column plugin. Storing files outside RAILS_ROOT
just use a symbolic link inside rails... cagan senturk schrieb:> Andrew Stone 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 > > >
cagan senturk
2006-Jun-28 19:59 UTC
[Rails] Re: Re: file_column plugin. Storing files outside RAILS_ROOT
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 -- Posted via http://www.ruby-forum.com/.