mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
Add initializer to include helpers in all assets (including .js)
This commit is contained in:
parent
c0da83c5de
commit
bd6f97fabc
2 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,5 @@
|
|||
//= require jquery-ui/widgets/sortable
|
||||
|
||||
<% environment.context_class.instance_eval { include RepositoryDatatableHelper } %>
|
||||
|
||||
var RepositoryDatatable = (function(global) {
|
||||
'use strict';
|
||||
|
||||
|
|
7
config/initializers/helpers_in_assets.rb
Normal file
7
config/initializers/helpers_in_assets.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
# This code will include the listed helpers in all the assets
|
||||
Rails.application.config.assets.configure do |env|
|
||||
env.context_class.class_eval do
|
||||
# This is required for repository_datatable.js.erb
|
||||
include RepositoryDatatableHelper
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue