From 28f7378d7d2bc2d79fa52f3dcedb734a543f69be Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 18:48:22 -0500 Subject: fix SessionsController#create --- app/controllers/sessions_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index a74cbd3..c3ff395 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -13,7 +13,7 @@ class SessionsController < ApplicationController respond_to do |format| if @user && @user.authenticate(params[:session][:password]) sign_in @user - redirect_to root_path + format.html { redirect_to root_path } else format.html { render action: 'new' } format.json { render json: @user.errors, status: :unprocessable_entity } -- cgit v1.2.3-2-g168b From cde35e3461bf49a4b32aefca7b8556e344c8090e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 18:48:38 -0500 Subject: login/logout buttons --- app/assets/stylesheets/custom.css.scss | 20 ++++++++------------ app/views/common/_signout.html.erb | 5 +++++ app/views/layouts/application.html.erb | 9 ++++----- 3 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 app/views/common/_signout.html.erb (limited to 'app') diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss index faecdce..0599a93 100644 --- a/app/assets/stylesheets/custom.css.scss +++ b/app/assets/stylesheets/custom.css.scss @@ -7,17 +7,13 @@ header > nav { #log-buttons { margin-top: 8px; - } - .signup { - @extend .btn; - @extend .btn-success; - } - .signin { + form { display: inline; } + a, input[type="submit"] { @extend .btn; - @extend .btn-info; + &.user { @extend .btn-info; } + &.signup { @extend .btn-success; } + &.signin { @extend .btn-info; } + &.signout { @extend .btn-danger; } } - .signout { - @extend .btn; - @extend .btn-danger; - } - } \ No newline at end of file + } +} diff --git a/app/views/common/_signout.html.erb b/app/views/common/_signout.html.erb new file mode 100644 index 0000000..2bdda0c --- /dev/null +++ b/app/views/common/_signout.html.erb @@ -0,0 +1,5 @@ +<%= +form_tag(sessions_path+"/current", method: "delete") do + submit_tag("Sign out", :class => "signout") +end +%> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9cc30bc..39d73dd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -19,12 +19,11 @@
<% if signed_in? %> - <%= current_user.user_name.upcase %> - <%= link_to "Sign out", "/signout", method: "delete", :class => "signout", :role => "button" %> + <%= link_to current_user.user_name, current_user, :class => "user" %> + <%= render "common/signout" %> <% else %> - <%= link_to "Log in", new_session_path, :class => "signin", :role => "button" %> - <%= link_to "Sign up", new_user_path, :class => "signup", :role => "button" - %> + <%= link_to "Log in", new_session_path, :class => "signin" %> + <%= link_to "Sign up", new_user_path, :class => "signup" %> <% end %>
-- cgit v1.2.3-2-g168b From 66d5669dbcc042317ca5d10759276ea5813f7081 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Tue, 4 Mar 2014 18:52:58 -0500 Subject: minor color changes --- app/assets/stylesheets/scaffolds.css.scss | 4 ++-- app/views/layouts/application.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss index 2c8c009..e4b33b3 100644 --- a/app/assets/stylesheets/scaffolds.css.scss +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -25,10 +25,10 @@ pre { a { color: #000; &:visited { - color: white; + color: #000; } &:hover { - color: white; + color: green; text-decoration: none; } } diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9cc30bc..cb4a3d6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,7 +9,7 @@