Skip to content

Commit

Permalink
adding back tabs to the profile
Browse files Browse the repository at this point in the history
  • Loading branch information
erik committed Jul 10, 2012
1 parent 7f1cbce commit 855cfef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/controllers/profiles_controller.rb
Expand Up @@ -25,10 +25,10 @@ def redirect_appropriately


def get_profile def get_profile
@profile = User.find(params[:id]) @profile = User.find(params[:id])
if ["assignments","pledges","donations","pitches","posts","tips","comments"].include?(params[:section]) if ["assignments","pledges","donations","pitches","posts","tips","comments"].include?(params[:tab])
@tab = params[:section] @tab = params[:tab]
if params[:section] != "donations" if params[:tab] != "donations"
@items = User.find_by_id(@profile.id).send(params[:section]).paginate(:all, :page => params[:page], :per_page => 20, @items = User.find_by_id(@profile.id).send(params[:tab]).paginate(:all, :page => params[:page], :per_page => 20,
:order => "created_at desc") :order => "created_at desc")
else else
@items = User.find_by_id(@profile.id).all_donations.paid.paginate(:all, :page => params[:page], :per_page => 20, @items = User.find_by_id(@profile.id).all_donations.paid.paginate(:all, :page => params[:page], :per_page => 20,
Expand Down
6 changes: 3 additions & 3 deletions config/routes.rb
Expand Up @@ -37,7 +37,9 @@
map.resources :donations, :credit_pitches, :affiliations, :pledges, :pages, :groups map.resources :donations, :credit_pitches, :affiliations, :pledges, :pages, :groups
map.connect "/profiles/:id/ban", :controller => "profiles", :action => "ban" map.connect "/profiles/:id/ban", :controller => "profiles", :action => "ban"
map.connect "/profiles/:id/unban", :controller => "profiles", :action => "unban" map.connect "/profiles/:id/unban", :controller => "profiles", :action => "unban"
map.resources :profiles map.resources :profiles do |profile|
profile.connect ":tab", :controller => "pitches", :action => "show", :requirements => { :tab => /"assignments|pledges|donations|pitches|posts|tips|comments/ }
end
map.resources :stories, :member => {:accept => :put, :reject => :put, :fact_check => :put, :publish => :put}, :has_many => :comments map.resources :stories, :member => {:accept => :put, :reject => :put, :fact_check => :put, :publish => :put}, :has_many => :comments
map.resources :tips, :has_many => [:affiliations, :comments] map.resources :tips, :has_many => [:affiliations, :comments]
map.resources :subscribers map.resources :subscribers
Expand Down Expand Up @@ -138,8 +140,6 @@
map.connect "/myspot/purchases/paypal_return", :controller => "myspot/purchases", :action => "paypal_return" map.connect "/myspot/purchases/paypal_return", :controller => "myspot/purchases", :action => "paypal_return"
map.connect "/myspot/purchases/paypal_ipn", :controller => "myspot/purchases", :action => "paypal_ipn" map.connect "/myspot/purchases/paypal_ipn", :controller => "myspot/purchases", :action => "paypal_ipn"


map.connect "/profiles/:profile_id/ban", :controller => "profiles", :action => "ban"

map.connect "/purchase/:pitch_id", :controller => "myspot/purchases", :action => "new" map.connect "/purchase/:pitch_id", :controller => "myspot/purchases", :action => "new"
map.namespace :myspot do |myspot| map.namespace :myspot do |myspot|
myspot.resource :profile do |profile| myspot.resource :profile do |profile|
Expand Down

0 comments on commit 855cfef

Please sign in to comment.