app/controllers/rooms_controller.rb
# frozen_string_literal: trueAdd an empty line after magic comments.class RoomsController < ApplicationControllerUse `%i` or `%I` for an array of symbols. before_action :set_room, only: [:show, :edit, :update, :destroy] # GET /rooms def index @rooms = Room.all end # GET /rooms/1Put empty method definitions on a single line. def show end # GET /rooms/new def new @room = Room.new end # GET /rooms/1/editPut empty method definitions on a single line. def edit end # POST /rooms def create @room = Room.new(room_params) if @room.save redirect_to @room, notice: 'Room was successfully created.' else render :new end end # PATCH/PUT /rooms/1 def update if @room.update(room_params) redirect_to @room, notice: 'Room was successfully updated.' else render :edit end end # DELETE /rooms/1 def destroy @room.destroy redirect_to rooms_url, notice: 'Room was successfully destroyed.' end Keep a blank line before and after `private`. private # Use callbacks to share common setup or constraints between actions.Inconsistent indentation detected. def set_room @room = Room.find(params[:id]) end # Only allow a trusted parameter "white list" through.Inconsistent indentation detected. def room_params params.require(:room).permit(:name, :rank) endend