Skip to content

Instantly share code, notes, and snippets.

@lexmag
Created July 27, 2012 18:08
Show Gist options
  • Save lexmag/3189458 to your computer and use it in GitHub Desktop.
Save lexmag/3189458 to your computer and use it in GitHub Desktop.
`disabled` vs `readonly` form helper options
<%= form_for @post do |f| %>
<%= f.text_field :title, value: 'It will never change', readonly: true %>
<%= f.text_field :description, value: 'You will not see it in params', disabled: true %>
<%= f.button :submit %>
<% end %>
<!-- params[:post] => { "title"=>"It will never change" } -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment