diff --git a/app/controllers/devise_auth/registrations_controller.rb b/app/controllers/devise_auth/registrations_controller.rb index 42acf0d..627faf7 100644 --- a/app/controllers/devise_auth/registrations_controller.rb +++ b/app/controllers/devise_auth/registrations_controller.rb @@ -16,15 +16,15 @@ class DeviseAuth::RegistrationsController < Devise::RegistrationsController if resource.active_for_authentication? set_flash_message :notice, :signed_up if is_navigational_format? sign_in(resource_name, resource) - redirect_to user_path(resource) + async_redirect_to user_path(resource) else set_flash_message :notice, :inactive_signed_up, :reason => resource.inactive_message.to_s if is_navigational_format? expire_session_data_after_sign_in! - redirect_to user_path(resource) + async_redirect_to user_path(resource) end else clean_up_passwords(resource) - respond_with_navigational(resource) { render :partial => "devise/registrations/new" } + async_redirect_to new_user_registration_path end end diff --git a/app/controllers/devise_auth/sessions_controller.rb b/app/controllers/devise_auth/sessions_controller.rb index 34d1e4c..4a0357d 100644 --- a/app/controllers/devise_auth/sessions_controller.rb +++ b/app/controllers/devise_auth/sessions_controller.rb @@ -7,10 +7,11 @@ class DeviseAuth::SessionsController < Devise::SessionsController end def create - resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new") + resource = warden.authenticate!(:scope => resource_name) + async_redirect_to new_user_session_path unless resource set_flash_message(:notice, :signed_in) if is_navigational_format? sign_in(resource_name, resource) - aysnc_redirect_to new_user_registration_path + async_redirect_to user_path(resource) end def destroy diff --git a/app/views/artists/_show.html.haml b/app/views/artists/_show.html.haml index c01f2c1..de8f66f 100644 --- a/app/views/artists/_show.html.haml +++ b/app/views/artists/_show.html.haml @@ -4,7 +4,8 @@ .tabs_js.information %h1 = artist.name - %span.heart + - if signed_in? + %span.heart %ul.nav %li= image_tag "icons/artist-info.png" %li= image_tag "icons/artist-links.png" diff --git a/app/views/devise/sessions/_new.html.erb b/app/views/devise/sessions/_new.html.erb index d03def8..f42b285 100644 --- a/app/views/devise/sessions/_new.html.erb +++ b/app/views/devise/sessions/_new.html.erb @@ -11,7 +11,7 @@
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
<% end -%> -<%= f.submit "Sign in" %>
+<%= f.submit "Login" %>
<% end %> <%= render :partial => "devise/shared/links" %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index f1e0374..211422c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ Nineminutes::Application.routes.draw do devise_for :users, - :controllers => { :omniauth_callbacks => "users/omniauth_callbacks", :registrations => "registrations", :sessions => "sessions" } + :controllers => { :omniauth_callbacks => "users/omniauth_callbacks", :registrations => "devise_auth/registrations", :sessions => "devise_auth/sessions" } devise_scope :user do get "/users/auth/:provider" => "users/omniauth_callbacks#passthru" get "/register" => "devise_auth/registrations#new", :as => :new_user_registration @@ -11,7 +11,6 @@ Nineminutes::Application.routes.draw do get "/logout" => "devise_auth/sessions#destroy", :as => :destroy_user_session end - get "tracks/index" match "/search_video", :to => "tracks#search_video" resources :artists, :only => [ :show ], :constraints => { :id => /.*/ }