Class: ElFinder2::Command::Rename

Inherits:
Base
  • Object
show all
Defined in:
lib/el_finder2/command/rename.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from HashUtils

#from_base64url, #to_base64url, #to_path

Constructor Details

This class inherits a constructor from ElFinder2::Command::Base

Instance Method Details

#executeObject



4
5
6
7
8
9
10
11
12
# File 'lib/el_finder2/command/rename.rb', line 4

def execute
  @file.name = @name
  @file.save!

  render json: {
    added: ActiveModel::ArraySerializer.new([@file]).as_json,
    removed: [@hash]
  }
end