Skip to content

Commit

Permalink
externalise jquery using jquery-raisl-cdn and jquery-rails fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlazypanda committed Jul 17, 2020
1 parent bbfd7d4 commit 82e0b82
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ gem 'lemmatizer', '~> 0.2.2'
gem 'mailman', require: false
# To implement fontawesome v4.7.0
gem "font-awesome-rails"
gem "lazyload-rails"
gem "lazyload-rails"
gem 'jquery-rails-cdn'

# To convert html to markdown
gem 'reverse_markdown'
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<%= jquery_include_tag :google, force: true %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<meta name="google-translate-customization" content="4ce4c7c384354172-5179499fc244f592-g2b333d0d29f59663-d" />
Expand Down
10 changes: 6 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ class Application < Rails::Application

# Enable the asset pipeline
config.assets.enabled = true

I18n.available_locales = [:en, :de, "zh-CN", :ar, :es, "hi-IN", :it, :ko, "pt-BR", :ru]
config.i18n.default_locale = :en
config.i18n.default_locale = :en

config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]

# rails will fallback to config.i18n.default_locale translation
config.i18n.fallbacks = true

# rails will fallback to en, no matter what is set as config.i18n.default_locale
config.i18n.fallbacks = [:en]

Expand All @@ -74,6 +74,8 @@ class Application < Rails::Application
config.paths.add File.join('app/api'), glob: File.join('**', '*.rb')
config.autoload_paths += Dir[Rails.root.join('app','api', '**', '*.rb')]

config.assets.precompile += ['jquery3.js']

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.assets.paths << Rails.root.join("public","lib")
Expand Down
1 change: 1 addition & 0 deletions config/initializers/jquery_cdn.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Jquery::Rails::Cdn.major_version = 3

0 comments on commit 82e0b82

Please sign in to comment.