How to execute JavaScript function on current page through Application Controller?

2

I'm doing a browser validation (IE < 10) through the Application Controller with gem "browser" . I need any JavaScript page with a message saying that browser is not recommended for any page of the application that is accessed.

Any idea, suggestion or other way of doing this dynamically?

Code:

class ApplicationController < ActionController::Base
  before_action :is_ie_browser?

  def is_ie_browser?
    if browser.ie? && browser.version.to_i < 10
      #executar uma funcao
    end
  end
end
    
asked by anonymous 10.06.2015 / 15:31

1 answer

1

You do not need gems or go through Rails.

Put in your javascripts a function that checks and gives the message.

Using jquery is simple:

link

    
10.06.2015 / 16:33