Calendar is shown
This commit is contained in:
@@ -6,7 +6,8 @@ class ReservationsController < ApplicationController
|
||||
# GET /reservations or /reservations.json
|
||||
def index
|
||||
|
||||
@reservations = Reservation.all
|
||||
@reservations = Reservation.all.includes(:team, :customer).where(company: @company)
|
||||
@reservations = ActiveModelSerializers::SerializableResource.new(@reservations).as_json
|
||||
end
|
||||
|
||||
# GET /reservations/1 or /reservations/1.json
|
||||
@@ -16,7 +17,7 @@ class ReservationsController < ApplicationController
|
||||
# GET /reservations/new
|
||||
def new
|
||||
@reservation = Reservation.new
|
||||
@reservation.place = @company.places.first
|
||||
@reservation.team = @company.teams.first
|
||||
end
|
||||
|
||||
# GET /reservations/1/edit
|
||||
@@ -70,7 +71,7 @@ class ReservationsController < ApplicationController
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def reservation_params
|
||||
params.require(:reservation).permit(:company_id, :customer_id, :place_id, :title, :description, :start_time, :end_time)
|
||||
params.require(:reservation).permit(:company_id, :customer_id, :team_id, :title, :description, :start_time, :end_time)
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
|
||||
Reference in New Issue
Block a user