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 end
def find_user def find_user
if params[:user_id]
@user = User.find params[:user_id] @user = User.find params[:user_id]
else
redirect_to user_closet_hangers_path(current_user)
end
end end
def find_closet_hangers! def find_closet_hangers!

View file

@ -89,7 +89,7 @@ module ItemsHelper
end end
def your_items_path 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 end
private private

View file

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

View file

@ -55,6 +55,8 @@ OpenneoImpressItems::Application.routes.draw do |map|
end end
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' => 'users#top_contributors', :as => :top_contributors
match 'users/top_contributors' => redirect('/users/top-contributors') match 'users/top_contributors' => redirect('/users/top-contributors')

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB