Class: Cropper::UploadsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/cropper/uploads_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



22
23
24
25
26
27
28
# File 'app/controllers/cropper/uploads_controller.rb', line 22

def create
  @upload.holder ||= @holder
  @upload.update_attributes(params[:upload])
  respond_with(@upload) do |format|
    format.js { render :partial => 'crop' }
  end
end

#destroyObject



41
42
43
44
# File 'app/controllers/cropper/uploads_controller.rb', line 41

def destroy
  @upload.destroy
  head :ok
end

#editObject



30
31
32
33
34
# File 'app/controllers/cropper/uploads_controller.rb', line 30

def edit
  respond_with(@upload) do |format|
    format.js { render :partial => 'crop' }
  end
end

#indexObject



8
9
10
# File 'app/controllers/cropper/uploads_controller.rb', line 8

def index
  respond_with(@uploads)
end

#newObject



16
17
18
19
20
# File 'app/controllers/cropper/uploads_controller.rb', line 16

def new
  respond_with @upload do |format|
    format.js { render :partial => 'pick' }
  end
end

#showObject



12
13
14
# File 'app/controllers/cropper/uploads_controller.rb', line 12

def show
  respond_with(@upload)
end

#updateObject



36
37
38
39
# File 'app/controllers/cropper/uploads_controller.rb', line 36

def update
  @upload.update_attributes(params[:upload])
  redirect_to @holder
end