Skip to content

Commit

Permalink
Use data attribute to fetch admin.js options
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Apr 26, 2017
1 parent e0eb6ca commit d69faac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/views/layouts/rails_admin/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
= stylesheet_link_tag "rails_admin/rails_admin.css", media: :all
= javascript_include_tag "rails_admin/rails_admin.js"
-# Initialize JS simple i18n
:javascript
RailsAdmin.I18n.init('#{I18n.locale}', JSON.parse("#{j I18n.t("admin.js").to_json}"))
%body.rails_admin
#admin-js{:'data-i18n-options' => I18n.t("admin.js").to_json}
:javascript
RailsAdmin.I18n.init('#{I18n.locale}', document.getElementById("admin-js").dataset.i18nOptions);
#loading.label.label-warning{style: 'display:none; position:fixed; right:20px; bottom:20px; z-index:100000'}= t('admin.loading')
%nav.navbar.navbar-default.navbar-fixed-top
= render "layouts/rails_admin/navigation"
Expand Down

0 comments on commit d69faac

Please sign in to comment.