My user visits an item show view and then is send to the signup-page (I use devise). On the signup page, I have the params (item_id) of the item he visited on the previous page. I want this item_id to be saved when the user makes his sign_up (like user.item_id). Here is how I tried to do it:
<input value="#{params[:item_id]}" type="hidden" name="user[item_id]" id="user_item_id">
When the user is saved, the item_id remains empty. What am I missing here? Here is what I put into my controller:
def configure_sign_up_params
devise_parameter_sanitizer.permit(:sign_up, keys: [:item_id])
end