From 2dd0434bd6022ab6ceeca5ccc80aa22c379e4b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 15 Dec 2009 09:26:11 +0100 Subject: [PATCH] Allow SessionsController to be used without authenticatable. --- TODO | 2 ++ app/views/sessions/new.html.erb | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 414d98be..7dba8d7b 100644 --- a/TODO +++ b/TODO @@ -1 +1,3 @@ * Make test run with different ORMs +* Add registerable support +* Add http authentication support \ No newline at end of file diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index b73c80dc..94476758 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,18 +1,20 @@

Sign in

-<% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%> -

<%= f.label :email %>

-

<%= f.text_field :email %>

+<%- if devise_mapping.authenticatable? %> + <% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%> +

<%= f.label :email %>

+

<%= f.text_field :email %>

-

<%= f.label :password %>

-

<%= f.password_field :password %>

+

<%= f.label :password %>

+

<%= f.password_field :password %>

- <% if devise_mapping.rememberable? -%> -

<%= f.check_box :remember_me %> <%= f.label :remember_me %>

+ <% if devise_mapping.rememberable? -%> +

<%= f.check_box :remember_me %> <%= f.label :remember_me %>

+ <% end -%> + +

<%= f.submit "Sign in" %>

<% end -%> - -

<%= f.submit "Sign in" %>

-<% end -%> +<% end%> <%- if devise_mapping.recoverable? %> <%= link_to "Forgot password?", new_password_path(resource_name) %>