4 changed files with 64 additions and 25 deletions
@ -0,0 +1,19 @@ |
|||||
|
class Users::RegistrationsController < Devise::RegistrationsController |
||||
|
protected |
||||
|
|
||||
|
def update_resource(resource, params) |
||||
|
# Wenn kein Passwort gesetzt werden soll: |
||||
|
if params[:password].blank? && params[:password_confirmation].blank? |
||||
|
resource.update_without_password(params.except(:current_password)) |
||||
|
else |
||||
|
super |
||||
|
end |
||||
|
end |
||||
|
|
||||
|
def configure_permitted_parameters |
||||
|
devise_parameter_sanitizer.permit(:account_update, keys: [ |
||||
|
required_hours_matrix: {}, |
||||
|
weekly_target_matrix: {} |
||||
|
]) |
||||
|
end |
||||
|
end |
||||
@ -1,14 +1,17 @@ |
|||||
Rails.application.routes.draw do |
Rails.application.routes.draw do |
||||
resources :entries |
|
||||
resource :user_goal, only: [:update] |
|
||||
root 'entries#index' |
|
||||
devise_for :users |
|
||||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html |
|
||||
|
|
||||
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. |
|
||||
# Can be used by load balancers and uptime monitors to verify that the app is live. |
|
||||
get "up" => "rails/health#show", as: :rails_health_check |
|
||||
|
|
||||
# Defines the root path route ("/") |
|
||||
# root "posts#index" |
|
||||
|
resources :entries |
||||
|
resource :user_goal, only: [:update] |
||||
|
root 'entries#index' |
||||
|
devise_for :users, controllers: { |
||||
|
registrations: 'users/registrations' |
||||
|
} |
||||
|
|
||||
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html |
||||
|
|
||||
|
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. |
||||
|
# Can be used by load balancers and uptime monitors to verify that the app is live. |
||||
|
get "up" => "rails/health#show", as: :rails_health_check |
||||
|
|
||||
|
# Defines the root path route ("/") |
||||
|
# root "posts#index" |
||||
end |
end |
||||
Loading…
Reference in new issue