Class: BookingsyncPortal::Admin::ConnectionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BookingsyncPortal::ApplicationController
- BaseController
- BookingsyncPortal::Admin::ConnectionsController
- Defined in:
- app/controllers/bookingsync_portal/admin/connections_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/bookingsync_portal/admin/connections_controller.rb', line 4 def create if remote_account? && BookingsyncPortal.create_remote_rental new_remote_rental = BookingsyncPortal.remote_rental_model.constantize.new(remote_account: remote_account) @connection = rental.create_connection(remote_rental: new_remote_rental) else @connection = rental.create_connection(remote_rental: remote_rental) end respond_to do |wants| wants.html { redirect_to admin_rentals_path } wants.js end end |
#destroy ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/bookingsync_portal/admin/connections_controller.rb', line 18 def destroy @connection = current_account.connections.find(params[:id]).destroy @not_connected_rentals = current_account.rentals.visible.ordered.not_connected @visible_rentals = current_account.rentals.visible respond_to do |wants| wants.html { redirect_to admin_rentals_path } wants.js end end |