Hi all,
I am trying me newly created photo album and after uploading one pic I
am having a problem with displaying this particular album.
ActionView::TemplateError (negative string size (or size too big)) on
line #14 of app/views/album/show.rhtml:11: <% if @album.pictures.size
0 %>12:
13:Foto’s
14: <%
for photo in @album.pictures %>15: <%= show_thumb photo
%>16: <%= draggable_element("#{photo.id}", :revert => true)
%>17: <% end %> /usr/local/lib/ruby/gems/1.8/gems/
activerecord-1.14.4/lib/active_record/connection_adapters/
postgresql_adapter.rb:406:inunescape_bytea' /usr/local/lib/ruby/ gems/1.8/gems/activerecord-1.14.4/lib/active_record/ connection_adapters/postgresql_adapter.rb:406:in
unescape_bytea’ /
usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/
connection_adapters/postgresql_adapter.rb:373:inselect' /usr/ local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/ connection_adapters/postgresql_adapter.rb:368:in
each_index’ /usr/
local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/
connection_adapters/postgresql_adapter.rb:368:inselect' /usr/ local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/ connection_adapters/postgresql_adapter.rb:366:in
each’ /usr/local/
lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/
connection_adapters/postgresql_adapter.rb:366:inselect' /usr/ local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/ connection_adapters/postgresql_adapter.rb:129:in
select_all’ /usr/
local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/
base.rb:390:infind_by_sql' /usr/local/lib/ruby/gems/1.8/gems/ activerecord-1.14.4/lib/active_record/base.rb:924:in
find_every’ /
usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/
base.rb:381:infind' /usr/local/lib/ruby/gems/1.8/gems/ activerecord-1.14.4/lib/active_record/associations/ has_many_association.rb:83:in
find’ /usr/local/lib/ruby/gems/1.8/
gems/activerecord-1.14.4/lib/active_record/associations/
has_many_association.rb:111:infind_target' /usr/local/lib/ruby/ gems/1.8/gems/activerecord-1.14.4/lib/active_record/associations/ association_proxy.rb:116:in
load_target’ /usr/local/lib/ruby/gems/
1.8/gems/activerecord-1.14.4/lib/active_record/associations/
association_proxy.rb:109:inmethod_missing' /usr/local/lib/ruby/ gems/1.8/gems/activerecord-1.14.4/lib/active_record/associations/ has_many_association.rb:90:in
method_missing’ #{RAILS_ROOT}/app/
views/album/show.rhtml:14:in `_run_rhtml_album_show’It seems I am hitting a string limit in that for loop, am I doing
something wrong or is there a better way to do exactly this? The pics
are stored in the database so I guess that last added picture is seen
as a string and hits the limit.Anyone here who knows a nice solution?
Regards,
Wijnand