Ruby on Rails Wednesday, June 1, 2011

hello,

i implementing a file upload using paperclip plugin. i getting the
following error [1] when uploading a file. I'm using the gems rails
v2.3.8 and paperclip v2.1.6. the parameter hash looks like [2], the
model like [3].

Interesting is that i get two different errors, on the localhost with
webrick it says:

Status: 500 Internal Server Error
no marshal_dump is defined for class Proc
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/
message_verifier.rb:38:in `dump'

on the server (same setup):

Status: 500 Internal Server Error
can't dump File
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/
message_verifier.rb:38:in `dump'

any hints?
thx

[2] Processing UploadItemController#create (for 84.119.78.19 at
2011-06-01 11:42:48) [POST]
Parameters: {"commit"=>"Upload", "action"=>"create",
"authenticity_token"=>"o5Dbbzd0CA45UpNQ++mQw5gQtoUkmbBT2UEP3FuPAbM=",
"controller"=>"upload_item", "upload_item"=>{"title"=>"dddd",
"upload"=>#<File:/tmp/RackMultipart7503-0>, "upload_rules"=>"0",
"description"=>"dsf"}}
Redirected to http://ichsehichseh.wirdorange.org/upload_items/new
Completed in 298ms (DB: 26) | 302 Found [http://
ichsehichseh.wirdorange.org/upload_items]

[1]
/!\ FAILSAFE /!\ Wed Jun 01 11:42:48 +0200 2011
Status: 500 Internal Server Error
can't dump File
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/
message_verifier.rb:38:in `dump'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/
message_verifier.rb:38:in `generate'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/
session/cookie_store.rb:157:in `marshal'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/
session/cookie_store.rb:106:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/
failsafe.rb:26:in `call'
/usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
/usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize'
/usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.8/lib/action_controller/
dispatcher.rb:106:in `call'
/usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in
`process_request'
/usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:
207:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
441:in `start_request_handler'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
381:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/utils.rb:252:in `safe_fork'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
377:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in
`start'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:
222:in `start'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:253:in
`spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:
126:in `lookup_or_add'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:247:in
`spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:
80:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:
79:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:246:in
`spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:145:in
`spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:278:in
`handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in
`main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
/usr/lib/phusion_passenger/passenger-spawn-server:61

[3]
has_attached_file :upload,
:styles => { :thumb => { :geometry => "200x200>",
:format => :png }},
:whiny => false

validates_attachment_content_type :upload,
:content_type => ['image/jpeg',
'image/png',
'image/gif',
'image/pjpeg',
'image/x-png',
'image/jpeg2000',
'application/pdf'], :message
=> 'Uploaded file is not an image nor pdf'

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Not sure where to report this but as its a Rails thing I'll mention it
here. The site that hosts the ActiveRecord Migration cheat sheet
http://dizzy.co.uk/ruby_on_rails/cheatsheets/rails-migrations has been
hijacked and redirects to http://www.arab75.com/vb/. Either the site
has been attacked or the ads on the page have been infected.

If anyone knows whoever runs this site can they give him a nudge,
please don't visit the site (especially of you have a Windows
machine).

Anyone know where to report this to, other than the site owner?

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Try using the :locals hash that can be passed with render to the view,
works fine for me.

On Jun 1, 11:22 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On Jun 1, 1:58 am, Herman <herman...@gmail.com> wrote:> Hi all,
>
> > In one of my create action in the controller, I am catching a error
> > and trying to show errors on the same page.  It was all good when I
> > called render action => 'new'.  However, I also wanted to append a
> > query string for consistence purposes.  How do I do that with render?
> > For now, I can only call redirect_to and put the error in the flash
> > variable which doesn't seems to be as clean of a solution.
>
> render just renders a template - you can't change the query string
> (without redirecting) because the browser shows the url it accessed.
> You could change your form to a get form if you wanted to (although
> that would put all the form parameters in the url)
>
> Fred> Thanks in advance.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.