Skip to content

Instantly share code, notes, and snippets.

@rubytastic
Created February 1, 2013 11:37

Revisions

  1. rubytastic created this gist Feb 1, 2013.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    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