carrierwave-mongoid-media/app/concerns/carrierwave_mongoid_media_controller.rb
2013-03-11 16:21:59 -04:00

30 lines
346 B
Ruby

module CarrierwaveMongoidMediaController
def show
resource.as_response_for(self)
end
def create
with_ok { create! }
end
def create!
resource.update_attributes(params)
end
def destroy
with_ok { destroy! }
end
def destroy!
resource.destroy
end
private
def with_ok
yield
head :ok
end
end