Skip to content
Snippets Groups Projects
Commit ef22b76b authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Simplify Projects::NotificationSettingsController

parent fe58c1f1
No related branches found
No related tags found
1 merge request!3421Decouple membership and notifications
class Projects::NotificationSettingsController < Projects::ApplicationController
before_action :authenticate_user!
 
def create
notification_setting = current_user.notification_settings_for(project)
saved = notification_setting.update_attributes(notification_setting_params)
render json: { saved: saved }
end
def update
notification_setting = current_user.notification_settings_for(project)
saved = notification_setting.update_attributes(notification_setting_params)
Loading
Loading
- if @notification_setting
= form_for @notification_setting, url: namespace_project_notification_setting_path(@project.namespace.becomes(Namespace), @project), remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
= form_for @notification_setting, url: namespace_project_notification_setting_path(@project.namespace.becomes(Namespace), @project), method: :patch, remote: true, html: { class: 'inline', id: 'notification-form' } do |f|
= f.hidden_field :level
%span.dropdown
%a.dropdown-new.btn.notifications-btn#notifications-button{href: '#', "data-toggle" => "dropdown"}
Loading
Loading
Loading
Loading
@@ -608,7 +608,7 @@ Rails.application.routes.draw do
 
resources :forks, only: [:index, :new, :create]
resource :import, only: [:new, :create, :show]
resource :notification_setting, only: [:create, :update]
resource :notification_setting, only: [:update]
 
resources :refs, only: [] do
collection do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment