use_strong_parameters
🔒 Use Strong Parameters for Safe JSON Input​
Strong Parameters help you whitelist incoming JSON fields so your API only accepts expected data. Define a private method in your controller to permit only the attributes you need.
# app/controllers/articles_controller.rb
class ArticlesController < ApplicationController
# ... actions ...
private
def article_params
params.require(:article).permit(:title, :content)
end
end