I am using Rails 3.2.14, inherited_resource and strong_parameter gem.I just followed Strong Parameters in Rails 3.2.8 steps but i am getting error like below,
Can't mass-assign protected attributes:content, title, nature_bien_id, nature_transaction_id, nbr_chambres, nbr_pieces, section_id, city, zip, surface_habitable, surface_terrain
My code in controller is like that
def create
@mandat = current_user.mandats.new(mandats_params)
end
private
def annonce_params
params.require(:annonce).permit(:created_at, :description, :image, :dpe, :nature_bien_id, :nature_transaction_id,:nbr_chambres, :nbr_pieces, :prix_net_acquereur, :section_id, :surface_habitable,:surface_terrain, :titre, :annonce_images_attributes, :user_id, :ville, :zip, :reference,:available_time, :is_valid, :close, :reasonclosing, :annonce_support_ids, :equipement_ids)
end
Thanks for in advance