rails hidden field default value

# Step 1: Open the corresponding view file (e.g., app/views/model_name/_form.html.erb).

# Step 2: Add a hidden field using the `hidden_field_tag` helper method.
<%= hidden_field_tag 'field_name', 'default_value' %>

# Step 3: Replace 'field_name' with the actual name of the field in your model.
# Replace 'default_value' with the desired default value for the hidden field.

# Example:
<%= hidden_field_tag 'user_id', current_user.id %>