Created
October 4, 2012 17:06
-
-
Save acidtib/3834995 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@states = State.find(params[:id]) | |
@towns = @states.towns.paginate(:page => params[:page], :per_page => 9).order("town") | |
@towns.each do |t| | |
t.postcards.last | |
t.postcards.count | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 class="pagetitle"><%= params[:state] %></h1> | |
<%= render 'layouts/search' %> | |
<div class="page_left"> | |
<div class="ex_index"> | |
<% @towns.each do |town| %> | |
<div class="span5 highlight"> | |
<a href="/explore/state/town?town=<%= town.postcards.last.city %>"> | |
<span class="btn pcount"><%= town.postcards.count %></span> | |
<span class="location-overlay"><%= town.town %></span> | |
<%= image_tag town.postcards.last.image_url(:featured), :class => "imgb image-shadow" %> | |
</a> | |
</div> | |
<% end %> | |
</div> | |
<div style="clear: both;"></div> | |
<div class="flickr_pagination"> | |
<%= will_paginate @towns, :class => "page_paginate" %> | |
</div> | |
</div> | |
<%= render 'layouts/sidebar' %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment