Add strong params to tag_masters_controller

This commit is contained in:
Eric Schultz 2019-11-05 12:50:28 -06:00
parent 3941665c7e
commit 7199b9b189

View file

@ -18,7 +18,7 @@ module Nonprofits
end end
def create def create
json_saved CreateTagMaster.create(current_nonprofit, params[:tag_master]) json_saved(current_nonprofit.tag_masters.create(tag_master_params[:tag_master]))
end end
def destroy def destroy
@ -27,5 +27,13 @@ module Nonprofits
tag_master.tag_joins.destroy_all tag_master.tag_joins.destroy_all
render json: {}, status: :ok render json: {}, status: :ok
end end
private
def tag_master_params
params.require(:tag_master).permit(:name).tap do |tag_params|
tag_params.require(:name) # SAFER
end
end
end end
end end