Class: IshManager::MarkersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IshManager::MarkersController
- Defined in:
- app/controllers/ish_manager/markers_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
-
#new ⇒ Object
def index authorize! :markers, ::Gameui::Map end.
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/ish_manager/markers_controller.rb', line 22 def create @marker = ::Gameui::Marker.new(marker_params) @marker.map = @map :create_marker, @map @map_id = @map.id respond_to do |format| if @marker.save format.html { redirect_to map_path(@map), notice: 'Marker was successfully created.' } else format.html { render :new } end end end |
#destroy ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'app/controllers/ish_manager/markers_controller.rb', line 48 def destroy @marker = ::Gameui::Marker.find params[:id] @map = @marker.map :destroy_marker, @map @marker.destroy respond_to do |format| format.html { redirect_to map_path(@map), notice: 'Marker was successfully destroyed.' } end end |
#edit ⇒ Object
18 19 20 |
# File 'app/controllers/ish_manager/markers_controller.rb', line 18 def edit :edit_marker, @map end |
#new ⇒ Object
def index
authorize! :markers, ::Gameui::Map
end
13 14 15 16 |
# File 'app/controllers/ish_manager/markers_controller.rb', line 13 def new :new_marker, ::Gameui::Map @marker = ::Gameui::Marker.new end |
#update ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/ish_manager/markers_controller.rb', line 37 def update :update_marker, @map respond_to do |format| if @marker.update(marker_params) format.html { redirect_to maps_path(@map), notice: 'Marker was successfully updated.' } else format.html { render :edit } end end end |