Skip to content
Extraits de code Groupes Projets
Valider 509a4072 rédigé par James Fleming's avatar James Fleming Validation de Jonne Haß
Parcourir les fichiers

Strong parameters for Block

parent a0a9f01b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -4,7 +4,7 @@ class BlocksController < ApplicationController
respond_to :html, :json
def create
block = current_user.blocks.new(params[:block])
block = current_user.blocks.new(block_params)
if block.save
disconnect_if_contact(block.person)
......@@ -39,4 +39,8 @@ class BlocksController < ApplicationController
current_user.disconnect(contact, :force => true)
end
end
def block_params
params.require(:block).permit(:person_id)
end
end
class Block < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
belongs_to :person
belongs_to :user
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter