change route for member action and change variable name to more likely name
parent
309b0e7374
commit
8ee2a5ebf4
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in New Issue