mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-19 04:06:04 +01:00
606629577a
the regexp alone and web browsers allows URLs to contain non-ASCII characters, which `URI.parse` does not like -- resulting in the inbox page to suddenly break. also changed the `redirect_to` in the controller to a `render :edit` so that validation errors are shown properly
20 lines
537 B
Ruby
20 lines
537 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Settings::SharingController < ApplicationController
|
|
before_action :authenticate_user!
|
|
|
|
def edit; end
|
|
|
|
def update
|
|
user_attributes = params.require(:user).permit(:sharing_enabled,
|
|
:sharing_autoclose,
|
|
:sharing_custom_url)
|
|
if current_user.update(user_attributes)
|
|
flash.now[:success] = t(".success")
|
|
else
|
|
flash.now[:error] = t(".error")
|
|
end
|
|
|
|
render :edit
|
|
end
|
|
end
|