问题
In the Rails docs, the first two listed options for the select
helper are :include_blank
and :prompt
. I've just realized that I'm using both in my code, but they seem to be interchangeable. Can anyone explain the difference? It's not clear to me from reading the docs.
回答1:
Main difference is:
include_blank: true
will render a blank option but
prompt: true
will execute
I18n.translate('helpers.select.prompt', :default => 'Please select')
来源:https://stackoverflow.com/questions/11302728/whats-the-difference-between-include-blank-and-prompt-in-the-rails-select-hel