lib/transponder.rb in transponder-0.1.5 vs lib/transponder.rb in transponder-0.8.2
- old
+ new
@@ -1,7 +1,22 @@
require 'transponder/version'
+require 'transponder/transmission'
require 'rails'
module Transponder
- class Engine < Rails::Engine
+ module ViewHelpers
+ def xms_module_name
+ params[:controller].include?('/') ? params[:controller].split('/')[0] : nil
+ end
+
+ def xms_event(module_name: nil, action: nil)
+ _module = module_name || xms_module_name || 'application'
+ _action = action || action_name
+ "ujs:#{_module}:#{controller_name}:#{_action}"
+ end
end
+
+ class Engine < ::Rails::Engine
+
+ end
end
+ActionView::Base.send :include, Transponder::ViewHelpers