Skip to content

Commit

Permalink
Allow SessionsController to be used without authenticatable.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 15, 2009
1 parent afab12f commit 2dd0434
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* Make test run with different ORMs
* Add registerable support
* Add http authentication support
22 changes: 12 additions & 10 deletions app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<h2>Sign in</h2>

<% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<%- if devise_mapping.authenticatable? %>
<% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>

<p><%= f.label :password %></p>
<p><%= f.password_field :password %></p>
<p><%= f.label :password %></p>
<p><%= f.password_field :password %></p>

<% if devise_mapping.rememberable? -%>
<p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
<% end -%>
<% if devise_mapping.rememberable? -%>
<p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
<% end -%>

<p><%= f.submit "Sign in" %></p>
<% end -%>
<p><%= f.submit "Sign in" %></p>
<% end -%>
<% end%>
<%- if devise_mapping.recoverable? %>
<%= link_to "Forgot password?", new_password_path(resource_name) %><br />
Expand Down

0 comments on commit 2dd0434

Please sign in to comment.