From 30445bb10809969ec5a006e7d2ca6f581168cf72 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 29 Apr 2014 16:42:01 -0400 Subject: re-jigger the sessions/login helpers. --- app/views/sessions/new.html.erb | 43 ++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'app/views/sessions/new.html.erb') diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index ff27762..97f09b6 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,23 +1,26 @@

Sign in

-<% if @user.nil? %> -

The email/username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email/username and password.

-<% end %> -
- <%= form_for(:session, url: sessions_path) do |f| %> -

- <%= f.label(:username_or_email, "Username/Email") %>
- <%= f.text_field :username_or_email%> -

-

- <%= f.label :password %>
- <%= f.password_field :password %> -

-

- <%= f.submit "Log in", class: "signin" %> -

- <% end %> - -

New user? <%= link_to("Sign up now!", new_user_path) %>

-
+
+ <%= form_tag(sessions_path, method: :post, id: :new_session) do %> + <% if params[:action] == "create" %> +
+

The username/password pair you entered did + not match our records. Check your typing and + try again.

+
+ <% end %> +

+ <%= label_tag(:username_or_email, "Username/Email") %>
+ <%= text_field_tag(:username_or_email) %> +

+

+ <%= label_tag(:password) %>
+ <%= password_field_tag(:password) %> +

+

+ <%= submit_tag("Log in", class: :signin) %> +

+ <% end %> +

New user? <%= link_to("Sign up now!", new_user_path) %>

+
-- cgit v1.2.3