From 8ee2a5ebf4397ce1d6faac5d1c485d5ebda2ac22 Mon Sep 17 00:00:00 2001 From: Coleman Date: Sat, 11 Oct 2008 17:36:01 -0500 Subject: [PATCH] change route for member action and change variable name to more likely name --- app/helpers/global_helpers.rb | 10 +++++----- config/router.rb | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/helpers/global_helpers.rb b/app/helpers/global_helpers.rb index 543f3c9..8f00616 100644 --- a/app/helpers/global_helpers.rb +++ b/app/helpers/global_helpers.rb @@ -9,9 +9,9 @@ module Merb end def photo_url(photo, w = nil, h = nil) - w = photo.width if w.nil? or w > photo.width - h = photo.height if h.nil? or h > photo.height - url :controller => 'photos', :action => 'thumbnail', :width => w, :height => h, :id => photo.id + w = photo.width if w.nil? or w.to_i > photo.width + h = photo.height if h.nil? or h.to_i > photo.height + "/photos/#{photo.id}/thumbnail?width=#{w}&height=#{h}" end def indicator @@ -38,8 +38,8 @@ module Merb @menu_items end - def pagination(block_name, base_url) - @pagination_block = block_name + def pagination(div_name, base_url) + @pagination_block = div_name @base_pagination_url = base_url partial 'home/pagination_script' end diff --git a/config/router.rb b/config/router.rb index 537c4dd..22bd717 100644 --- a/config/router.rb +++ b/config/router.rb @@ -1,14 +1,15 @@ Merb.logger.info("Compiling routes...") Merb::Router.prepare do |r| - r.match('/').to( :controller => 'home', :action => 'index' ) - r.match('/acceptable_use').to( :controller => 'home', :action => 'acceptable_use' ) + # custom routes for specific thingeys + r.match('/').to(:controller => 'home', :action => 'index') + r.match('/acceptable_use').to(:controller => 'home', :action => 'acceptable_use') + r.match('/disclaimer').to(:controller => 'home', :action => 'disclaimer') r.match('/hall_of_fame').to(:controller => 'home', :action => 'hall_of_fame') + # restful things r.resources :sessions r.resources :users - r.resources :people r.resources :votes r.resources :favorites - r.match('/photos/thumbnail/:id').to(:controller => 'photos', :action => 'thumbnail') - r.resources :photos + r.resources :photos, :member => { :thumbnail => :get } end