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 655c1c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/generators/blacklight/assets_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def assets

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 655c1c5

Please sign in to comment.