app/controllers/geopolitical/hoods_controller.rb in geopolitical-0.0.1 vs app/controllers/geopolitical/hoods_controller.rb in geopolitical-0.8.0
- old
+ new
@@ -1,12 +1,18 @@
module Geopolitical
- class HoodsController < ApplicationController
+ class HoodsController < GeopoliticalController
inherit_resources
# belongs_to :city
# respond_to :html, :xml, :json
+ before_filter :load_relatives, :only => [:new, :edit, :create, :update]
def collection
- @hoods = Hood.ordered.search(params[:search], params[:page])
+ @hoods = Hood.ordered.page(params[:page])
end
+ private
+
+ def load_relatives
+ @cities = City.only(:name).map {|e| [e.name,e.id]}
+ end
end
end