Class: Workarea::Api::Admin::ShippingRatesController
Instance Method Summary
collapse
#current_user, #sort_direction, #sort_field
Instance Method Details
#create ⇒ Object
93
94
95
96
97
98
99
100
|
# File 'app/controllers/workarea/api/admin/shipping_rates_controller.rb', line 93
def create
@rate = @shipping_service.rates.create!(params[:rate])
respond_with(
{ rate: @rate },
{ status: :created,
location: shipping_service_rates_path(@shipping_service) }
)
end
|
#destroy ⇒ Object
215
216
217
218
|
# File 'app/controllers/workarea/api/admin/shipping_rates_controller.rb', line 215
def destroy
@rate.destroy
head :no_content
end
|
#index ⇒ Object
89
90
91
|
# File 'app/controllers/workarea/api/admin/shipping_rates_controller.rb', line 89
def index
respond_with rates: @shipping_service.rates
end
|
#update ⇒ Object
210
211
212
213
|
# File 'app/controllers/workarea/api/admin/shipping_rates_controller.rb', line 210
def update
@rate.update_attributes!(params[:rate])
respond_with rate: @rate
end
|