migrate from turbolinks to turbo
This commit is contained in:
@@ -1,9 +1,52 @@
|
||||
class RpWorldsController < ApplicationController
|
||||
before_action :set_rp_world, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /rp_worlds
|
||||
def index
|
||||
@rp_worlds = RpWorld.all
|
||||
end
|
||||
|
||||
def show
|
||||
# GET /rp_worlds/1
|
||||
def show; end
|
||||
|
||||
# GET /rp_worlds/1/edit
|
||||
def edit; end
|
||||
|
||||
# POST /rp_worlds
|
||||
def create
|
||||
@rp_world = RpWorld.new(rp_world_params)
|
||||
|
||||
if @rp_world.save
|
||||
redirect_to @rp_world, notice: 'Rp world was successfully created.'
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /rp_worlds/1
|
||||
def update
|
||||
if @rp_world.update(rp_world_params)
|
||||
redirect_to @rp_world, notice: 'Rp world was successfully updated.'
|
||||
else
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /rp_worlds/1
|
||||
def destroy
|
||||
@rp_world.destroy
|
||||
redirect_to rp_worlds_url, notice: 'Rp world was successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_rp_world
|
||||
@rp_world = RpWorld.includes(:wow_characters).find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def rp_world_params
|
||||
params.require(:rp_world).permit(:name, :description)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user