Module: Ramaze::Helper::Upload::ClassMethods
- Includes:
- Traited
- Defined in:
- lib/ramaze/helper/upload.rb
Overview
Helper class methods. Methods in this module will be available in your controller class (not your controller instance).
Instance Method Summary collapse
-
#handle_uploads_for(*args) ⇒ Object
This method will activate automatic handling of uploaded files for specified actions in the controller.
-
#upload_options(options) ⇒ Object
Sets options for file uploads in the controller.
Instance Method Details
#handle_uploads_for(*args) ⇒ Object
This method will activate automatic handling of uploaded files for specified actions in the controller.
255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/ramaze/helper/upload.rb', line 255 def handle_uploads_for(*args) args.each do |arg| if arg.respond_to?(:first) and arg.respond_to?(:last) before(arg.first.to_sym) do get_uploaded_files(arg.last) end else before(arg.to_sym) do get_uploaded_files end end end end |
#upload_options(options) ⇒ Object
Sets options for file uploads in the controller.
339 340 341 342 343 344 345 |
# File 'lib/ramaze/helper/upload.rb', line 339 def () trait( :upload_options => Ramaze::Helper::Upload::ClassMethods.trait[ :default_upload_options ].merge() ) end |