Could you help me understand why the following code works:
def activity_params
params.require(:activity).permit(:name, :description, :location, :user_id, category_ids: [])
end
Yet when I put the array somewhere in the middle instead of last, I get a syntax error:
def activity_params
params.require(:activity).permit(:name, :description, :location, category_ids: [], :user_id)
end