molten-trunk/molten5_withgrid/app/helpers/application_helper.rb
# 
# Creates links to available pages.  
# Accepts an options hash with the following options:
#   - kind: If provided, the total count of object is provided.
#   - pages: The Page object to apply pages to. Defaults to +@pages+.
#   - params: merges these with the existing params
Creates links to available pages.
Accepts an options hash with the following options:
kind: If provided, the total count of object is provided.
pages: The Page object to apply pages to. Defaults to +@pages+.
params: merges these with the existing params
Creates links to available pages . Accepts an options hash with the following options : kind : If provided the total count of object is provided . pages : The Page object to apply pages to . Defaults to + @pages + . params : merges these with the existing params
def pages( options = {} )
    options = {:kind => nil, :pages => @pages, :params => {}}.merge(options)
    if options[:pages] and options[:pages].page_count > 1
      html = <<-END
        <div class="pages">
          Page: #{pagination_links(options[:pages], {:window_size => 6, :params => params.merge(options[:params]).reject { |key,value| key == 'controller' }}).sub(/\d+(?=\s|$)/, '<span class="this_page">\&</span>').sub("...", '<span class="break">...</span>')}
          #{options[:kind].nil? ? "" : "(#{options[:pages].last_page.last_item} #{options[:kind]})"}
        </div>
      END
    end
  end
def pages ( options = { } ) options = { :kind => nil , :pages => @pages , :params => { } } . merge ( options ) if options [ :pages ] and options [ :pages ] . page_count > 1 html = <<-END 
        <div class="pages">
          Page:  #{ pagination_links ( options [ :pages ] , { :window_size => 6 , :params => params . merge ( options [ :params ] ) . reject { | key , value | key == 'controller' } } ) . sub ( / \d +(?= \s |$) / , '<span class="this_page">\&</span>' ) . sub ( "..." , '<span class="break">...</span>' ) } #{ options [ :kind ] . nil? ? "" : "(#{options[:pages].last_page.last_item} #{options[:kind]})" } 
        </div>
       END end end
Creates links to available pages.
Creates links to available pages .
options