Class: IshManager::MapsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ish_manager/maps_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#home

Instance Method Details

#createObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/ish_manager/maps_controller.rb', line 24

def create
  @map = ::Gameui::Map.new(map_params)
  authorize! :create, @map

  respond_to do |format|
    if @map.save
      format.html { redirect_to map_path(@map), notice: 'Map was successfully created.' }
    else
      format.html { render :new }
    end
  end
end

#destroyObject



48
49
50
51
52
53
54
# File 'app/controllers/ish_manager/maps_controller.rb', line 48

def destroy
  authorize! :destroy, @map
  @map.destroy
  respond_to do |format|
    format.html { redirect_to maps_path, notice: 'Map was successfully destroyed.' }
  end
end

#editObject



20
21
22
# File 'app/controllers/ish_manager/maps_controller.rb', line 20

def edit
  authorize! :edit, @map
end

#indexObject



6
7
8
9
# File 'app/controllers/ish_manager/maps_controller.rb', line 6

def index
  authorize! :index, ::Gameui::Map
  @maps = ::Gameui::Map.all
end

#newObject



15
16
17
18
# File 'app/controllers/ish_manager/maps_controller.rb', line 15

def new
  authorize! :new, ::Gameui::Map
  @map = ::Gameui::Map.new
end

#showObject



11
12
13
# File 'app/controllers/ish_manager/maps_controller.rb', line 11

def show
  authorize! :show, @map
end

#updateObject



37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/ish_manager/maps_controller.rb', line 37

def update
  authorize! :update, @map
  respond_to do |format|
    if @map.update(map_params)
      format.html { redirect_to map_path(@map), notice: 'Map was successfully updated.' }
    else
      format.html { render :edit }
    end
  end
end