Skip to content

Instantly share code, notes, and snippets.

@liwh
Created April 2, 2011 16:34
Show Gist options
  • Save liwh/899624 to your computer and use it in GitHub Desktop.
Save liwh/899624 to your computer and use it in GitHub Desktop.
Started POST "/products/upload" for 10.0.2.2 at 2011-04-02 09:32:59 -0700
Processing by ProductsController#upload as HTML
Parameters: {"authenticity_token"=>"BzEqlVKPZdsgez1zKBBlFa6sF/TVrQGq+wWIlv5XASI=", "id"=>"4d974f7f5585d322a1000004", "photo"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0xb157434 @original_filename="252320434a6.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"photo[file]\"; filename=\"252320434a6.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20110402-8865-71g0vl>>}}
MONGODB shopqi_development['users'].find({:_id=>BSON::ObjectId('4d974c8e5585d34c3c000001')})
MONGODB shopqi_development['stores'].find({:_id=>BSON::ObjectId('4d974c8e5585d34c3c000002')})
MONGODB shopqi_development['products'].find({"store_id"=>BSON::ObjectId('4d974c8e5585d34c3c000002'), :_id=>BSON::ObjectId('4d974f7f5585d322a1000004')})
qi_development['products'].update({"_id"=>BSON::ObjectId('4d974f7f5585d322a1000004')}, {"$pushAll"=>{"photos"=>[{"_id"=>BSON::ObjectId('4d974fc05585d322a1000013'), "updated_at"=>2011-04-02 16:33:07 UTC, "file_filename"=>"252320434a6.jpg", "created_at"=>2011-04-02 16:33:07 UTC}]}})
Rendered products/_photo.html.haml (5.8ms)
Rendered products/upload.html.haml (18.8ms)
Completed 200 OK in 2992ms (Views: 30.2ms)
Started GET "/gridfs/uploads/icon_252320434a6.jpg" for 10.0.2.2 at 2011-04-02 09:33:07 -0700
ActionController::RoutingError (No route matches "/gridfs/uploads/icon_252320434a6.jpg"):
Rendered vendor/bundle/ruby/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.9ms)
@saberma
Copy link

saberma commented Apr 3, 2011

图片的地址/gridfs/uploads/icon_252320434a6.jpg
要改为/gridfs/#{id} 的形式,nginx那里只根据id查找

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment