This repository was archived by the owner on Jan 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-17
lines changed Expand file tree Collapse file tree 2 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 11
11
12
12
ActionView ::Base . send :include , PluploadHelper
13
13
14
- config . middleware . insert_before 'ActionDispatch::ParamsParser' , 'PluploadParamsRenamer'
14
+ config . middleware . insert_before 'ActionDispatch::ParamsParser' , 'ActionDispatch:: PluploadParamsRenamer'
Original file line number Diff line number Diff line change 1
- require 'rack/utils'
2
-
3
- class PluploadParamsRenamer
4
- def initialize ( app )
5
- @app = app
6
- end
7
-
8
- def call ( env )
9
- req = Rack ::Request . new ( env )
10
- if req . POST [ "_plupload_upload" ]
11
- object , method = req . params [ "_plupload_upload" ] . split ( /[\[ \] ]/ )
12
- req . params [ object ] ||= { }
13
- req . params [ object ] [ method ] = req . params [ "file" ] #req.POST[req.POST["_plupload_upload"]] = req.POST["file"]
14
- end
15
-
16
- @app . call ( env )
1
+ require 'action_dispatch/http/request'
2
+ module ActionDispatch
3
+ class PluploadParamsRenamer
4
+ def initialize ( app )
5
+ @app = app
6
+ end
7
+
8
+ def call ( env )
9
+ req = Request . new ( env )
10
+ if req . POST [ "_plupload_upload" ]
11
+ object , method = req . params [ "_plupload_upload" ] . split ( /[\[ \] ]/ )
12
+ req . params [ object ] ||= { }
13
+ req . params [ object ] [ method ] = req . params [ "file" ] #req.POST[req.POST["_plupload_upload"]] = req.POST["file"]
14
+ end
15
+
16
+ @app . call ( env )
17
+ end
17
18
end
18
19
end
You can’t perform that action at this time.
0 commit comments