Last active
November 30, 2018 19:40
-
-
Save edezekiel/4f7f4e34a235f909f9c785ad545c4efa to your computer and use it in GitHub Desktop.
example form_for and collection select to build a new employee form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#app/view/new.html.erb | |
<%= form_for @employee do | f | %> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
<%= f.label :dog %> | |
<%= f.collection_select :dog_id, @dogs, :id, :name %> | |
<%= f.submit %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment