Permit extra params in special cases with Strong Params in Rails 4
问题 So for an organization, I want users to be able to be able to edit some things about it. params.require(:organization).permit(:name, :location) But in special cases, I want administrators to be able to edit extra attributes params.require(:organization).permit(:name, :location, :secrets) Now I know I can just have an if statement to choose which line I want to use, but since the admin will always be able to edit the original attributes, I wanted to easily be able to include them like so: