fix bug when removing all keywords in protocol

This commit is contained in:
Mojca Lorber 2017-11-14 15:04:37 +01:00
parent 8ba27f734e
commit c2a5b52767

View file

@ -180,8 +180,10 @@ class ProtocolsController < ApplicationController
def update_keywords def update_keywords
respond_to do |format| respond_to do |format|
# sanitize user input # sanitize user input
params[:keywords].collect! do |keyword| if params[:keywords]
escape_input(keyword) params[:keywords].collect! do |keyword|
escape_input(keyword)
end
end end
if @protocol.update_keywords(params[:keywords]) if @protocol.update_keywords(params[:keywords])
format.json do format.json do