Skip to content

Instantly share code, notes, and snippets.

@rubytastic
Created February 1, 2013 11:37
Show Gist options
  • Save rubytastic/4690816 to your computer and use it in GitHub Desktop.
Save rubytastic/4690816 to your computer and use it in GitHub Desktop.
class JavascriptsController < ApplicationController
skip_before_filter :authenticate_user!
respond_to :js
layout false
#caches_page :locale # don't know if this is reset on server restart.
def locale
# http://edgeguides.rubyonrails.org/caching_with_rails.html
# get all the controller strings and put them back as JSON
@translations = I18n.backend.send(:translations)
#@translations = I18n.translate('javascripts')
render :json => @translations
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment