rails disable submit button

# 1. In your view file (e.g., app/views/your_controller/your_action.html.erb), find the form where the submit button is located.

# 2. Locate the submit button element and add the 'disabled' attribute to it.

<%= form_with model: @your_model do |form| %>
  # ... other form fields ...

  <%= form.submit 'Submit', disabled: true %>

<% end %>

# 3. Optionally, you can use a condition to enable or disable the submit button based on a certain condition.

<%= form_with model: @your_model do |form| %>
  # ... other form fields ...

  <%= form.submit 'Submit', disabled: @your_condition %>

<% end %>

# 4. In your controller action, set the value of @your_condition based on your business logic.

def your_action
  # ... your controller logic ...

  @your_condition = true  # Set to true to disable the submit button, or false to enable it.

  # ... more controller logic ...
end