hi, i''m trying to play with attachment_fu using imagescience, and...it
works, partially...
when i send the form the image is uploaded and it''s resized and the
thumb made, and inserted in the db.
But after this an error is occurred (every time):
TypeError (singleton can''t be dumped):
/usr/lib/ruby/1.8/pstore.rb:349:in `dump''
/usr/lib/ruby/1.8/pstore.rb:349:in `dump''
/usr/lib/ruby/1.8/pstore.rb:330:in `transaction''
/usr/lib/ruby/1.8/cgi/session/pstore.rb:81:in `update''
/usr/lib/ruby/1.8/cgi/session/pstore.rb:88:in `close''
/usr/lib/ruby/1.8/cgi/session.rb:324:in `close''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1184:in
`close_session''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1228:in
`process_cleanup_without_flash''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/flash.rb:146:in
`process_cleanup_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:662:in
`process_cleanup_without_session_management_support''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:124:in
`process_cleanup_without_components''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/components.rb:178:in
`process_cleanup''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:435:in
`process_without_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in
`process_without_session_management_support''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
`process''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in
`process''
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
`dispatch''
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in
`handle_dispatch''
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in
`service''
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread''
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread''
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each''
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start''
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start''
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in
`dispatch''
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require''
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
`new_constants_in''
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require''
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require''
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
./script/server:3
-e:4:in `load''
-e:4
this is the controller:
def aaaaa
@image = Image.new
end
def bbbbb
@image = Image.new(params[:image])
if @image.save
flash[:notice] = ''image was successfully created.''
redirect_to :action => :aaaaa
else
render :action => :new
end
end
model:
has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 500.kilobytes,
:resize_to => ''320x200>'',
:thumbnails => { :thumb =>
''100x100>'' }
validates_as_attachment
view:
<%= error_messages_for :image %>
<% form_for(:image, :url => {:action => :bbbbb}, :html => {
:multipart
=> true }) do |f| -%>
<p>
<label for="image">Upload An image:</label>
<%= f.file_field :uploaded_data %>
</p>
<p>
<%= submit_tag ''Create'' %>
</p>
<% end -%>
table:
create_table :images do |t|
t.column :parent_id, :integer
t.column :content_type, :string
t.column :filename, :string
t.column :thumbnail, :string
t.column :size, :integer
t.column :width, :integer
t.column :height, :integer
end
it''s about 3 hours i''m trying to fix this, but without any
result....and
the code is the same i found here:
http://clarkware.com/cgi/blosxom/2007/02/24
can anyone help me? please :(
thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---