Hey, I''ve gotten file_column to upload a file, drop it in the dynamic directory, but I can''t display the image, the directories repeat themselves: My model: class Person < ActiveRecord::Base file_column :image_url In my view: <%= image_tag url_for_file_column(''person'', ''image_url'') %> HTML generated is this: <img alt="Male_face" src="/dhcp/public/dhcp/public/person/image_url/3/male_face.jpg" /> There shouldn''t be two ''/dhcp/public'' there. -- - Nic
On 1/16/06, Nic Werner <nicwerner@gmail.com> wrote:> Hey, > > I''ve gotten file_column to upload a file, drop it in the dynamic > directory, but I can''t display the image, the directories repeat > themselves: > > My model: > > class Person < ActiveRecord::Base > file_column :image_url > > In my view: > > <%= image_tag url_for_file_column(''person'', ''image_url'') %> > > HTML generated is this: > > <img alt="Male_face" > src="/dhcp/public/dhcp/public/person/image_url/3/male_face.jpg" /> > > There shouldn''t be two ''/dhcp/public'' there. > > -- > - Nic > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >I know that with the addition of named routes, Rails uses xxxx_url, and possibly either reserves it, or attaches magic functionality. What happens when you rename your field? -- Kyle Maxwell Chief Technologist E Factor Media // FN Interactive kyle@efactormedia.com 1-866-263-3261
Thanks, that fixed part of the problem - I can use image_tag, but not the url_for_file_column version: <%= image_tag(@person[''image'']) %> *** WORKS *** <%= image_tag url_for_file_column(''person'', ''image'') %> *** SAME PROBLEM *** I guess I''ll just use the original image_tag, thanks! - Nic. On 1/16/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote:> On 1/16/06, Nic Werner <nicwerner@gmail.com> wrote: > > Hey, > > > > I''ve gotten file_column to upload a file, drop it in the dynamic > > directory, but I can''t display the image, the directories repeat > > themselves: > > > > My model: > > > > class Person < ActiveRecord::Base > > file_column :image_url > > > > In my view: > > > > <%= image_tag url_for_file_column(''person'', ''image_url'') %> > > > > HTML generated is this: > > > > <img alt="Male_face" > > src="/dhcp/public/dhcp/public/person/image_url/3/male_face.jpg" /> > > > > There shouldn''t be two ''/dhcp/public'' there. > > > > -- > > - Nic > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > I know that with the addition of named routes, Rails uses xxxx_url, > and possibly either reserves it, or attaches magic functionality. > What happens when you rename your field? > > -- > Kyle Maxwell > Chief Technologist > E Factor Media // FN Interactive > kyle@efactormedia.com > 1-866-263-3261 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- - Nic
Actually, that doesn''t work, because image_tag just looked in /images, where I happened to have the same jpg. I need to use image_tag url_for_file_column to point to the dynamic directory, but it repeats the /dhcp/public twice: <img alt="Werner" src="/dhcp/public/dhcp/public/person/image/1/werner.jpg" /> Anybody have any thoughts? On 1/16/06, Nic Werner <nicwerner@gmail.com> wrote:> Thanks, that fixed part of the problem - I can use image_tag, but not > the url_for_file_column version: > > <%= image_tag(@person[''image'']) %> *** WORKS *** > <%= image_tag url_for_file_column(''person'', ''image'') %> *** SAME PROBLEM *** > > I guess I''ll just use the original image_tag, thanks! > > - Nic. > > On 1/16/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > On 1/16/06, Nic Werner <nicwerner@gmail.com> wrote: > > > Hey, > > > > > > I''ve gotten file_column to upload a file, drop it in the dynamic > > > directory, but I can''t display the image, the directories repeat > > > themselves: > > > > > > My model: > > > > > > class Person < ActiveRecord::Base > > > file_column :image_url > > > > > > In my view: > > > > > > <%= image_tag url_for_file_column(''person'', ''image_url'') %> > > > > > > HTML generated is this: > > > > > > <img alt="Male_face" > > > src="/dhcp/public/dhcp/public/person/image_url/3/male_face.jpg" /> > > > > > > There shouldn''t be two ''/dhcp/public'' there. > > > > > > -- > > > - Nic > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > I know that with the addition of named routes, Rails uses xxxx_url, > > and possibly either reserves it, or attaches magic functionality. > > What happens when you rename your field? > > > > -- > > Kyle Maxwell > > Chief Technologist > > E Factor Media // FN Interactive > > kyle@efactormedia.com > > 1-866-263-3261 > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > - Nic >-- - Nic
Hey Nic, On 1/17/06, Nic Werner <nicwerner@gmail.com> wrote:> I''ve gotten file_column to upload a file, drop it in the dynamic > directory, but I can''t display the image, the directories repeat > themselves: > > My model: > > class Person < ActiveRecord::Base > file_column :image_url > > In my view: > > <%= image_tag url_for_file_column(''person'', ''image_url'') %> > > HTML generated is this: > > <img alt="Male_face" > src="/dhcp/public/dhcp/public/person/image_url/3/male_face.jpg" /> > > There shouldn''t be two ''/dhcp/public'' there.Is your rails app deployed at a sub-path (e.g., not directly at top-level)? file_column has some issues here, that I''m currently working on (Ara did some debugging, I just have to catch up). Sebastian
Hey Sebastian, It is displayed at sub-path, meaning I have WebRoot as the top level for Apache, and then the app ''dhcp'' is off of that, making it: /dhcp/public/person/image/1/male_face.jpg Is that what you''re referring to? Thanks for the response, this has been holding me back. I''ll try pointing Apache at the app and see if that makes a difference - Nic. On 1/18/06, Sebastian Kanthak <skanthak@gmail.com> wrote:> Hey Nic, > > On 1/17/06, Nic Werner <nicwerner@gmail.com> wrote: > > I''ve gotten file_column to upload a file, drop it in the dynamic > > directory, but I can''t display the image, the directories repeat > > themselves: > > > > My model: > > > > class Person < ActiveRecord::Base > > file_column :image_url > > > > In my view: > > > > <%= image_tag url_for_file_column(''person'', ''image_url'') %> > > > > HTML generated is this: > > > > <img alt="Male_face" > > src="/dhcp/public/dhcp/public/person/image_url/3/male_face.jpg" /> > > > > There shouldn''t be two ''/dhcp/public'' there. > > Is your rails app deployed at a sub-path (e.g., not directly at > top-level)? file_column has some issues here, that I''m currently > working on (Ara did some debugging, I just have to catch up). > > Sebastian > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- - Nic