Skip to content

Instantly share code, notes, and snippets.

@aag1091
Created September 2, 2013 11:47
Show Gist options
  • Save aag1091/6412033 to your computer and use it in GitHub Desktop.
Save aag1091/6412033 to your computer and use it in GitHub Desktop.
Form with remote submit
<div class="row new_register">
<%= flash_messages %>
<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => 'new_box_1 sign_in large-5 push-1 columns'}) do |f| %>
<h6>Registered users <b>login</b> here</h6>
<h5>If you are already registered, enter your details and login below.</h5>
<%= f.input :email, :required => false, :autofocus => true, :label => false, :placeholder => "EMAIL", :input_html => { :class => 'prefer' } %>
<%= f.input :password, :required => false, :label => false, :placeholder => "PASSWORD", :input_html => { :class => 'prefer' } %>
<%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
<%= f.button :submit, "Sign in", :class => 'small button alert' %>
<br/><br/><br/>
<div><%= link_to "Forgot your password?", new_password_path(resource_name) %></div>
<div class="social_login">
<div class="login_txt">You can also <b>login</b> using — </div>
<%- User.omniauth_providers.each do |provider| %>
<%= link_to '', omniauth_authorize_path('user', provider), :class => "login_#{provider}", :title => provider %>
<% end -%>
</div>
<% end %>
<div class="large-1 columns"></div>
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :class => 'new_box_1 sign_up large-5 pull-1 columns' }) do |f| %>
<h6>New users <b>register</b> here</h6>
<h5>Fill in the details below to register with us.</h5>
<%= f.input :full_name, :required => true, :autofocus => true, :label => false, :placeholder => "FULLNAME", :input_html => { :class => 'prefer' } %>
<%= f.input :username, :required => true, :autofocus => true, :label => false, :placeholder => "USERNAME", :input_html => { :class => 'prefer' } %>
<%= f.input :email, :required => true, :autofocus => true, :label => false, :placeholder => "EMAIL", :input_html => { :class => 'prefer' } %>
<%= f.input :password, :required => true, :label => false, :placeholder => "PASSWORD", :input_html => { :class => 'prefer' } %>
<%= f.input :password_confirmation, :required => true, :label => false, :placeholder => "CONFIRM PASSWORD", :input_html => { :class => 'prefer' } %>
<%= f.button :submit, "REGISTER", :class => 'small button alert' %>
<% end %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment