Sha256: 7973c55cd9d646dc673363197be94fe61a7053baf69708f40a16300dc50a92d0
Contents?: true
Size: 1.17 KB
Versions: 11
Compression:
Stored size: 1.17 KB
Contents
class BookingsController < ApplicationController before_action :set_booking, only: [:show, :edit, :update, :destroy] # GET /bookings def index @bookings = Booking.all end # GET /bookings/1 def show end # GET /bookings/new def new @booking = Booking.new end # GET /bookings/1/edit def edit end # POST /bookings def create @booking = Booking.new(booking_params) if @booking.save redirect_to @booking, notice: 'Booking was successfully created.' else render action: 'new' end end # PATCH/PUT /bookings/1 def update if @booking.update(booking_params) redirect_to @booking, notice: 'Booking was successfully updated.' else render action: 'edit' end end # DELETE /bookings/1 def destroy @booking.destroy redirect_to bookings_url, notice: 'Booking was successfully destroyed.' end private # Use callbacks to share common setup or constraints between actions. def set_booking @booking = Booking.find(params[:id]) end # Only allow a trusted parameter "white list" through. def booking_params params.require(:booking).permit(:thing, :referrer) end end
Version data entries
11 entries across 11 versions & 1 rubygems