I’m retrieving a param in a controller from a form, from which I want to remove a hash and put into a variable for later use.
Let’s assume the param include the following:
@form_data = params[:project] // <-- :id, :title, :description, :members
‘:members’ is an array (retrieved from checkboxes) and I want that array to be put in a new variable for later use, and it should be removed from the param.
@members // <-- should contain :members
@project = Project.new(params[:project]) // <-- ':members' is removed
How could this be done?
You can use delete method