A memo about how to add values to strong parameters in Ruby on Rails with the Ruby language.
Example of adding user_id
def hashmodel_params
params.require(:hashmodel).permit(:title, :content, :user_id)
end
This way, you can define values that cannot be added with form_tag, such as user_id associated with the User in a one-to-many relationship, and add the value when the create action is called.
def create
params[:hashmodel][:user_id] = current_user.id
end