Sha256: b690b746b39bee7c08f4e48c2fb9d86130546e91c63e3aef8d76150d880606e4

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 KB

Contents

<%%= form_for(@<%= singular_table_name %>) do |f| %>
  <%% if @<%= singular_table_name %>.errors.any? %>
    <div id="error_explanation">
      <h2><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>

      <ul>
      <%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
        <li><%%= msg %></li>
      <%% end %>
      </ul>
    </div>
  <%% end %>
<% goma_config.authentication_keys.each do |key| -%>
  <div class="field">
    <%%= f.label :<%= key %> %><br>
    <%%= f.text_field :<%= key %> %>
  </div>
<% end -%>
  <div class="field">
    <%%= f.label :<%= goma_config.password_attribute_name %> %><br>
    <%%= f.password_field :<%= goma_config.password_attribute_name %> %>
  </div>
  <div class="field">
    <%%= f.label :<%= goma_config.password_confirmation_attribute_name %> %><br>
    <%%= f.password_field :<%= goma_config.password_confirmation_attribute_name %> %>
  </div>

<% attributes.each do |attribute| -%>
  <div class="field">
  <%- if attribute.reference? -%>
    <%%= f.label :<%= attribute.column_name %> %><br>
    <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %> %>
  <%- else -%>
    <%%= f.label :<%= attribute.name %> %><br>
    <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
  <%- end -%>
  </div>
<% end -%>
  <div class="actions">
    <%%= f.submit ( @<%= singular_table_name %>.try(:persisted?) ? 'Update' : 'Sign up' ) %>
  </div>
<%% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
goma-0.0.1.rc3 lib/generators/goma/erb/templates/user/_form.html.erb
goma-0.0.1.rc2 lib/generators/goma/erb/templates/user/_form.html.erb
goma-0.0.1.rc1 lib/generators/goma/erb/templates/user/_form.html.erb