19 lines
437 B
Ruby
19 lines
437 B
Ruby
class Crm::BookingsController < ApplicationController
|
|
|
|
def update_booking
|
|
booking = Booking.find(params[:booking_id])
|
|
|
|
|
|
status = booking.update_attributes(booking_status: params[:type])
|
|
|
|
if status == true
|
|
render json: JSON.generate({:status => true ,:type => params[:type]})
|
|
|
|
else
|
|
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
|
|
|
end
|
|
end
|
|
|
|
end
|