I have a basic form in rails:
<% form_for shipping_object do |f| %>
<%= f.text_field :address1, :placeholder => "Address Line 1*", :class => "forms" %><br/>
<%= f.text_field :address2, :placeholder => "Address Line 2", :class => "forms" %>
<%= f.collection_select :state_id, @states.where(country_id: f.object.country_id).order(:name), :id, :name, include_blank: '-- select state --' %>
<%= f.text_field :state_name, placeholder: 'State', class: 'forms' %>
<%= f.text_field :zipcode, :placeholder => "Zip Code*", :class => "forms" %>
<% end %>
I'd like to have a UI/UX checkbox element that a user can click and have all the form areas populated with pre-defined variables, but I'm not sure how I would do that. I'm assuming it's done with .attr methods in Javascript, but I'm not sure how?