Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
blueroot committed Mar 8, 2011
1 parent c87b435 commit b3099ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/controllers/categories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ class CategoriesController < ApplicationController

def show
@categories = Category.published_categories
@category = Category.find(params[:id])
@data_sets = @category.data_sets.paginate :page => params[:page], :conditions => {:status => "published"}, :order => 'data_sets.created_at desc', :per_page => 20

show!
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def index
def show
@organization = Organization.find(params[:id])
#@data_sets = @organization.published_data_set
@data_sets = @organization.data_sets.paginate :page => params[:page], :conditions => {:status => "published"}, :order => 'name', :per_page => 20
@data_sets = @organization.data_sets.paginate :page => params[:page], :conditions => {:status => "published"}, :order => 'data_sets.created_at desc', :per_page => 20
show!
end

Expand Down
6 changes: 4 additions & 2 deletions app/views/categories/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@
</table>
</div>

<% unless @category.data_sets.blank? %>
<% unless @data_sets.blank? %>
<div id="data_list">
<%= render @category.data_sets %>
<%= render @data_sets %>
</div>
<%= will_paginate(@data_sets) %>
<% else %>
<p>We were not able to find any data sets for <%= @category.name%>.</p>
<% end %>
Expand Down

0 comments on commit b3099ca

Please sign in to comment.