Skip to content

Commit

Permalink
Update asset generator to match 5.2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Mar 26, 2018
1 parent c270496 commit 7c1a4dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/generators/blacklight/assets_generator.rb
Expand Up @@ -9,12 +9,12 @@ def assets
return if has_blacklight_assets?

contents = "\n//\n// Required by Blacklight\n"
contents += "//= require jquery\n" if rails_5_1?
contents += "//= require jquery\n" if needs_jquery?
contents += "//= require blacklight/blacklight\n"

marker = if turbolinks?
'//= require turbolinks'
elsif rails_5_1?
elsif needs_jquery?
'//= require rails-ujs'
else
'//= require jquery_ujs'
Expand All @@ -27,13 +27,13 @@ def assets

# This is not a default in Rails 5.1
def add_jquery
gem 'jquery-rails' if rails_5_1?
gem 'jquery-rails' if needs_jquery?
end

private

def rails_5_1?
Rails.version =~ /5\.1/
def needs_jquery?
Rails.version >= '5.1'
end

def turbolinks?
Expand Down

0 comments on commit 7c1a4dd

Please sign in to comment.