app/controllers/program_planner_controller.rb
#
# Add an item to a room
#
Add an item to a room
Add an item to a room
def addItem
    begin
      ProgrammeItem.transaction do
        @assignment = nil
        if !params[:cancel]
          item = ProgrammeItem.find(params[:itemid])
          room = Room.find(params[:roomid])
          day = params[:day]
          time = params[:time].to_time 
          @assignment = addItemToRoomAndTime(item, room, day, time)
        end
        render :layout => 'content'
      end
    rescue => ex
      render status: :bad_request, text: ex.message
    end
  end
def addItem begin ProgrammeItem . transaction do @assignment = nil if ! params [ :cancel ] item = ProgrammeItem . find ( params [ :itemid ] ) room = Room . find ( params [ :roomid ] ) day = params [ :day ] time = params [ :time ] . to_time @assignment = addItemToRoomAndTime ( item , room , day , time ) end render :layout => 'content' end rescue => ex render status : :bad_request , text : ex . message end end
Add an item to a room
Add an item to a room
# The start time