mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
22 lines
461 B
Ruby
22 lines
461 B
Ruby
# frozen_string_literal: true
|
|
|
|
class PlacesController < ApplicationController
|
|
before_action :authenticate_user!
|
|
before_action :set_place, only: :destroy
|
|
|
|
def index
|
|
@places = current_user.places.page(params[:page]).per(20)
|
|
end
|
|
|
|
def destroy
|
|
@place.destroy!
|
|
|
|
redirect_to places_url, notice: 'Place was successfully destroyed.', status: :see_other
|
|
end
|
|
|
|
private
|
|
|
|
def set_place
|
|
@place = current_user.places.find(params[:id])
|
|
end
|
|
end
|