Module: ActionView::Helpers::UrlHelper
- Defined in:
- app/controllers/rails_ext.rb
Instance Method Summary collapse
-
#convert_confirm_option_to_javascript!(html_options) ⇒ Object
Modify the original behaviour of
link_to
so that the link includes the client’s timezone as URL paramtimezone
in the request.
Instance Method Details
#convert_confirm_option_to_javascript!(html_options) ⇒ Object
Modify the original behaviour of link_to
so that the link includes the client’s timezone as URL param timezone
in the request. Can be used by server to adjust formatting of UTC dates so they match the client’s time zone.
83 84 85 86 87 88 89 90 |
# File 'app/controllers/rails_ext.rb', line 83 def convert_confirm_option_to_javascript!() # We're adding this JS call to add the timezone info as a URL param. ["onclick"] = "intercept(this);" if .include?(:confirm) ["onclick"] += "return confirm('#{[:confirm]}');" .delete(:confirm) end end |