Class: OrganizationsController

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

Constant Summary

Constants inherited from ApplicationController

ApplicationController::APP_DOMAIN

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #canonical_url, #check_domain, #ensure_domain, #get_notice

Instance Method Details

#showObject


4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/organizations_controller.rb', line 4

def show
  canonical_url("/organizations/#{params[:id]}")
  @organization = Rails.cache.fetch("public_org_#{params[:id]}", expires_in: 15.minutes) do
    Organization.find(params[:id])
  end
  @animals = Rails.cache.fetch("public_org_animals_#{params[:id]}", expires_in: 15.minutes) do
    Animal.where(public: 1, organization_id: @organization.id)
  end
  
  respond_with(@organization)
end