Class: OrganizationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/organizations_controller.rb

Instance Method Summary (collapse)

Methods inherited from ApplicationController

#conditions

Instance Method Details

- (Object) index

returns organizations in json based upon certain paramters

Examples:

Organization.new.get_details(“codeforamerica”)



17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/organizations_controller.rb', line 17

def index
    conditions(Org)
  
    @org = Org.where(@conditions.join(" and ")).paginate(
      :per_page => 25, :page => params[:page])
  
    respond_to do |format|
      format.json { render :json => @org.to_json}      
    end
end