bootstrap-ruby / bootstrap_form

Official repository of the bootstrap_form gem, a Rails form builder that makes it super easy to create beautiful-looking forms using Bootstrap 5.
MIT License
1.64k stars 351 forks source link

I can't Disable select field #670

Closed Ahmunna closed 1 year ago

Ahmunna commented 1 year ago

I have this form

# file.html.haml
= bootstrap_form_tag(url: my_url) do |f|
  = f.select :nationality, nationalities, { selected: 'FR', disabled: true }

I can't disable the select field for some reason, do you have any idea why ?

shivam091 commented 1 year ago

@Ahmunna You have follwing wrong syntax of select. Please check the syntax and make sure options and html_options you passed are at right place.

Thank you

donv commented 1 year ago

The correct syntax is

  = f.select :nationality, nationalities, {selected: 'FR'}, disabled: true