Hmm, I''m using file_column and going by this tutorial, the files upload ok and I can see the fields updated in the database, but I am getting this error: "Trying to access file_column, but primary key got lost." Thanks in advance -- Posted via http://www.ruby-forum.com/.
Sorry, this is what it I am getting back from this code: view: <% @images.each do |@image| %> <p>Title: <%=h @image.name %></p> <%= image_tag url_for_file_column(''image'',''file'') %> <% end %> controller: def list_images @images = Image.find(:all) end #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:398:in `relative_path_prefix'' #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:349:in `initialize'' #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:16:in `create_state'' #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:628:in `file_state'' #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:641:in `file_relative_path'' #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column_helper.rb:75:in `url_for_file_column'' #{RAILS_ROOT}/app/views/admin/list_images.rhtml:3:in `_run_rhtml_admin_list_images'' #{RAILS_ROOT}/app/views/admin/list_images.rhtml:1:in `_run_rhtml_admin_list_images'' -e:3 -- Posted via http://www.ruby-forum.com/.
I don''t have code in front of me, but I think the problem is in your url_for_file_column I think it should be: url_for_file_column(@image,''file'') instead. Right now you are just passing url_for_file_column a string with contents ''image'', not the @image object (with the attendant id). Nicholas P. Mueller Jason Pfeifer wrote:> Sorry, this is what it I am getting back from this code: > > view: > > <% @images.each do |@image| %> > <p>Title: <%=h @image.name %></p> > <%= image_tag url_for_file_column(''image'',''file'') %> > <% end %> > > controller: > > def list_images > @images = Image.find(:all) > end > > > #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:398:in > `relative_path_prefix'' > #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:349:in > `initialize'' > #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:16:in > `create_state'' > #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:628:in > `file_state'' > #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column.rb:641:in > `file_relative_path'' > #{RAILS_ROOT}/vendor/plugins/file_column/lib/file_column_helper.rb:75:in > `url_for_file_column'' > #{RAILS_ROOT}/app/views/admin/list_images.rhtml:3:in > `_run_rhtml_admin_list_images'' > #{RAILS_ROOT}/app/views/admin/list_images.rhtml:1:in > `_run_rhtml_admin_list_images'' > -e:3 > >
> Jason Pfeifer wrote: >> Sorry, this is what it I am getting back from this code: >> >> view: >> >> <% @images.each do |@image| %> >> <p>Title: <%=h @image.name %></p> >> <%= image_tag url_for_file_column(''image'',''file'') %> >> <% end %><% for image in @images do -%> <%= image_tag url_for_file_column(''image'', ''file'') %> <% end -%>>> >> controller: >> >> def list_images >> @images = Image.find(:all) >> end-- Name : Arie Kusuma Atmaja, A.K.A Arie, A.K.A ariekeren / YM! = riyari3 Blog : http://ariekusumaatmaja.wordpress.com Ruby : http://groups.yahoo.com/groups/id-ruby !Ruby : http://indoforums.com/englishklab 500 lines in PHP dkk VS 1 line in Ruby dkk 300 baris di Java dkk VS 1 baris di Ruby dkk Macih ngotot pake (as|ph)p? haree geneee????