Created
July 29, 2012 21:11
-
-
Save lexmag/3201853 to your computer and use it in GitHub Desktop.
DRYing Up Rails Views
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
<%= simple_form_for(@product) do |f| %> | |
<%= f.input :title %> <!-- string --> | |
<%= f.input :description %> <!-- text --> | |
<%= yield(f) if block_given? %> | |
<%= f.button :submit %> | |
<% end %> |
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
<%= render layout: 'form' do |f| %> | |
<%= f.input :availability %> <!-- boolean --> | |
<% end %> |
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
<%= render layout: 'form' do |f| %> | |
<%= f.input :part_number %> <!-- integer --> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment