missing bookings controller adding
This commit is contained in:
18
app/controllers/crm/bookings_controller.rb
Normal file
18
app/controllers/crm/bookings_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
2
app/helpers/crm/bookings_helper.rb
Normal file
2
app/helpers/crm/bookings_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Crm::BookingsHelper
|
||||
end
|
||||
5
spec/controllers/crm/bookings_controller_spec.rb
Normal file
5
spec/controllers/crm/bookings_controller_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Crm::BookingsController, type: :controller do
|
||||
|
||||
end
|
||||
15
spec/helpers/crm/bookings_helper_spec.rb
Normal file
15
spec/helpers/crm/bookings_helper_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'rails_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the Crm::BookingsHelper. For example:
|
||||
#
|
||||
# describe Crm::BookingsHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
RSpec.describe Crm::BookingsHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
Reference in New Issue
Block a user