Module: Resourcery::ControllerExtensions::InstanceMethods

Defined in:
lib/resourcery/controller_extensions.rb

Instance Method Summary collapse

Instance Method Details

#createObject



41
42
43
44
# File 'lib/resourcery/controller_extensions.rb', line 41

def create
  resource.save
  respond_with resource
end

#destroyObject



46
47
48
49
# File 'lib/resourcery/controller_extensions.rb', line 46

def destroy
  resource.destroy
  redirect_to resource_class
end

#editObject



28
29
30
# File 'lib/resourcery/controller_extensions.rb', line 28

def edit
  respond_with resource
end

#indexObject



20
21
22
# File 'lib/resourcery/controller_extensions.rb', line 20

def index
  respond_with collection
end

#newObject



37
38
39
# File 'lib/resourcery/controller_extensions.rb', line 37

def new
  respond_with resource_ivar
end

#showObject



24
25
26
# File 'lib/resourcery/controller_extensions.rb', line 24

def show
  respond_with resource
end

#updateObject



32
33
34
35
# File 'lib/resourcery/controller_extensions.rb', line 32

def update
  resource.update_attributes(params[singular_resource_name])
  respond_with resource
end