Sha256: b3cd31449b133fe8f55f36c7a5e57f3b89233cafb277ddcb23941d9a5fdd8093

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

module Raddar
  class Users::EmailPreferencesController < Raddar::ApplicationController
    skip_after_action :verify_authorized

    def edit
      @user = current_user
      @user.email_preferences ||= {}
    end

    def update
      @user = current_user

      @user.update_attributes(email_preferences_params)

      redirect_to edit_user_email_preferences_path, notice: t('flash.users.email_preferences.update')
    end

    private

    def email_preferences_params
      params.require(:user).permit(email_preferences: User.email_preferences_keys)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
raddar-0.0.1.pre app/controllers/raddar/users/email_preferences_controller.rb