Update method and route

This commit is contained in:
Alfredo Sumaran 2016-06-02 15:21:15 -05:00
parent f011f038cd
commit fa6593b226
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ class Projects::LabelsController < Projects::ApplicationController
before_action :label, only: [:edit, :update, :destroy]
before_action :authorize_read_label!
before_action :authorize_admin_labels!, only: [
:new, :create, :edit, :update, :generate, :destroy
:new, :create, :edit, :update, :generate, :destroy, :remove_priority
]
respond_to :js, :html
@ -83,7 +83,7 @@ class Projects::LabelsController < Projects::ApplicationController
end
end
def set_sorting
def set_priorities
Label.transaction do
params[:label_ids].each_with_index do |label_id, index|
label = @project.labels.find_by_id(label_id)

View File

@ -719,7 +719,7 @@ Rails.application.routes.draw do
resources :labels, constraints: { id: /\d+/ } do
collection do
post :generate
post :set_sorting
post :set_priorities
end
member do