- content_for(:section_header) do
  .section_header{:class => 'people'}
    %h1= "#{@tag} people".strip.titleize
    = link_to "+ Add Someone", new_person_path, :class => 'new', :id => 'new_person'
    #view_options
      %span.sorting
        %strong Sort by:
        = sort_link(:name) + ","
        = sort_link(:created_at, :label => "Date added", :default_order => :desc) + ","
        = sort_link(:random, :is_default => :asc)
      %span.view
        %strong View as:
        = link_to_unless_current "List", people_path
        = "|"
        = link_to_unless_current "Grid", grid_people_path

- if @view == :grid
  = render :partial => 'grid', :object => @people
- else
  = render :partial => 'list', :object => @people

- content_for(:section_header) do
  .section_header{:class => 'people'}
    %h1= "#{@tag} people".strip.titleize
    = link_to "+ Add Someone", new_person_path, :class => 'new', :id => 'new_person'
    #view_options
      %span.sorting
        %strong Sort by:
        = sort_link(:name) + ","
        = sort_link(:created_at, :label => "Date added", :default_order => :desc) + ","
        = sort_link(:random, :is_default => :asc)
      %span.view
        %strong View as:
        = link_to_unless_current "List", people_path(:page => params[:page], :column => params[:column], :order => params[:order])
        = "|"
        = link_to_unless_current "Grid", grid_people_path(:page => params[:page], :column => params[:column], :order => params[:order])

- if @view == :grid
  = render :partial => 'grid', :object => @people
- else
  = render :partial => 'list', :object => @people

Maintain pagination and sorting when switching between list and grid views
Maintain pagination and sorting when switching between list and grid views