Created
November 16, 2016 19:53
-
-
Save cannikin/8d24a73f8ff82fc43457095a70a05f07 to your computer and use it in GitHub Desktop.
Standardizing forms
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
<%# currently on signup form %> | |
<%= f.label :first_name, :class => 't2 medium mb3 block grow' do %> | |
First Name | |
<%= f.text_field :first_name, :class => 'field-text mt1', :placeholder => 'No need for formalities' %> | |
<% end %> | |
<%# | |
One potential custom form helper. How many of the classes that are set above | |
should be defaults? | |
%> | |
<%= f.wnw_text_with_label :first_name, :placeholder => 'No need for formalities' %> | |
<%# | |
Custom form helper that assumes fewer default classes. | |
Label includes "t2 medium block grow" already | |
Input includes "field-text" already | |
%> | |
<%= f.wnw_text_with_label :first_name, :input_classes => 'mt1', | |
:label_classes => 'mb3', :placeholder => 'No need for formalities' %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment