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
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
Sorry, this is what it I am getting back from this code:
view:
<% @images.each do |@image| %>
Title: <%=h @image.name %>
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
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 P. wrote:
Sorry, this is what it I am getting back from this code:
view:
<% @images.each do |@image| %>
Title: <%=h @image.name %>
<%= 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 A., A.K.A Arie, A.K.A ariekeren / YM! = riyari3
Blog : http://ariekusumaatmaja.wordpress.com
Ruby : Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos
!Ruby : IndoForums.com is for sale | HugeDomains
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???
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs