allow your_items_path to be cached on home
This commit is contained in:
parent
ceeb59973d
commit
dacfc99ce7
3 changed files with 4 additions and 6 deletions
|
@ -97,8 +97,10 @@ class ClosetHangersController < ApplicationController
|
||||||
def find_user
|
def find_user
|
||||||
if params[:user_id]
|
if params[:user_id]
|
||||||
@user = User.find params[:user_id]
|
@user = User.find params[:user_id]
|
||||||
else
|
elsif user_signed_in?
|
||||||
redirect_to user_closet_hangers_path(current_user)
|
redirect_to user_closet_hangers_path(current_user)
|
||||||
|
else
|
||||||
|
redirect_to login_path(:return_to => request.fullpath)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -88,10 +88,6 @@ module ItemsHelper
|
||||||
end.to_sentence.html_safe
|
end.to_sentence.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def your_items_path
|
|
||||||
user_signed_in? ? user_closet_hangers_path(current_user) : login_path(:return_to => current_user_items_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def build_on_pet_types(species, special_color=nil, &block)
|
def build_on_pet_types(species, special_color=nil, &block)
|
||||||
|
|
|
@ -55,7 +55,7 @@ OpenneoImpressItems::Application.routes.draw do |map|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
match 'users/current-user/closet' => 'closet_hangers#index', :as => :current_user_items
|
match 'users/current-user/closet' => 'closet_hangers#index', :as => :your_items
|
||||||
|
|
||||||
match 'users/top-contributors' => 'users#top_contributors', :as => :top_contributors
|
match 'users/top-contributors' => 'users#top_contributors', :as => :top_contributors
|
||||||
match 'users/top_contributors' => redirect('/users/top-contributors')
|
match 'users/top_contributors' => redirect('/users/top-contributors')
|
||||||
|
|
Loading…
Reference in a new issue