Skip to content
Browse files

extract sign_in form into partial so that other login methods can be …

…added easily
  • Loading branch information...
1 parent 77bb97a commit 0db11ce168522550e37936a0703adccd9cbdf437 @TMaYaD TMaYaD committed Sep 1, 2011
Showing with 14 additions and 13 deletions.
  1. +13 −0 app/views/sessions/_form.html.erb
  2. +1 −13 app/views/sessions/new.html.erb
View
13 app/views/sessions/_form.html.erb
@@ -0,0 +1,13 @@
+<%= form_for :session, :url => session_path do |form| %>
+ <div class="text_field">
+ <%= form.label :email %>
+ <%= form.text_field :email, :type => "email" %>
+ </div>
+ <div class="text_field">
+ <%= form.label :password %>
+ <%= form.password_field :password %>
+ </div>
+ <div class="submit_field">
+ <%= form.submit "Sign in" %>
+ </div>
+<% end %>
View
14 app/views/sessions/new.html.erb
@@ -1,18 +1,6 @@
<h2>Sign in</h2>
-<%= form_for :session, :url => session_path do |form| %>
- <div class="text_field">
- <%= form.label :email %>
- <%= form.text_field :email, :type => "email" %>
- </div>
- <div class="text_field">
- <%= form.label :password %>
- <%= form.password_field :password %>
- </div>
- <div class="submit_field">
- <%= form.submit "Sign in" %>
- </div>
-<% end %>
+<%= render :partial => '/sessions/form' %>
<ul>
<li>

0 comments on commit 0db11ce

Please sign in to comment.
Something went wrong with that request. Please try again.