mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
22 lines
434 B
Ruby
22 lines
434 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Settings::MapsController < ApplicationController
|
|
before_action :authenticate_user!
|
|
|
|
def index
|
|
@maps = current_user.safe_settings.maps
|
|
end
|
|
|
|
def update
|
|
current_user.settings['maps'] = settings_params
|
|
current_user.save!
|
|
|
|
redirect_to settings_maps_path, notice: 'Settings updated'
|
|
end
|
|
|
|
private
|
|
|
|
def settings_params
|
|
params.require(:maps).permit(:name, :url)
|
|
end
|
|
end
|