Skip to content

Instantly share code, notes, and snippets.

@budnik
Last active December 11, 2015 10:29
Show Gist options
  • Save budnik/4587241 to your computer and use it in GitHub Desktop.
Save budnik/4587241 to your computer and use it in GitHub Desktop.
class LocaleController < ApplicationController
respond_to :json
caches_page :show, :gzip => :best_compression
def show
expires_in 1.year
respond_with YAML::load File.open File.join Rails.root, %W[config locales #{params[:id]}.yml]
end
end
MyApp::Application.routes.draw do
resources :locale, :only => :show
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment