Skip to content

Instantly share code, notes, and snippets.

@cannikin
Created November 16, 2016 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cannikin/8d24a73f8ff82fc43457095a70a05f07 to your computer and use it in GitHub Desktop.
Save cannikin/8d24a73f8ff82fc43457095a70a05f07 to your computer and use it in GitHub Desktop.
Standardizing forms
<%# 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