your items link on home

This commit is contained in:
Emi Matchu 2011-07-31 18:45:53 -04:00
parent 359356bcf3
commit 037cb1e95a
5 changed files with 14 additions and 8 deletions

View file

@ -95,7 +95,11 @@ class ClosetHangersController < ApplicationController
end
def find_user
if params[:user_id]
@user = User.find params[:user_id]
else
redirect_to user_closet_hangers_path(current_user)
end
end
def find_closet_hangers!

View file

@ -89,7 +89,7 @@ module ItemsHelper
end
def your_items_path
user_signed_in? ? user_closet_hangers_path(current_user) : login_path
user_signed_in? ? user_closet_hangers_path(current_user) : login_path(:return_to => current_user_items_path)
end
private

View file

@ -29,15 +29,15 @@
- cache :action_suffix => 'sections_and_description' do
%ul#sections
%li
%a{:href => "http://forum.openneo.net"}
= image_tag 'forum.png'
= link_to image_tag('your_items.png'), your_items_path
%h3
%a{:href => "http://forum.openneo.net/"} Forum
= link_to 'Your Items', your_items_path
%div
%h4 Join our community!
%h4 Track and trade!
%p
Show off your designs, ask for advice, or play silly forum games
here.
Make lists of the items you own and want, and share them with the
world.
%li
%a{:href => items_path}
= image_tag 'items.png'

View file

@ -55,6 +55,8 @@ OpenneoImpressItems::Application.routes.draw do |map|
end
end
match 'users/current-user/closet' => 'closet_hangers#index', :as => :current_user_items
match 'users/top-contributors' => 'users#top_contributors', :as => :top_contributors
match 'users/top_contributors' => redirect('/users/top-contributors')

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB