Class: Glib::JsonUi::ActionBuilder::Windows::OpenWeb
- Inherits:
-
Action
- Object
- JsonUiElement
- Action
- Glib::JsonUi::ActionBuilder::Windows::OpenWeb
- Defined in:
- app/helpers/glib/json_ui/action_builder/windows.rb
Instance Attribute Summary
Attributes inherited from JsonUiElement
Instance Method Summary collapse
-
#url(value, options = {}) ⇒ Object
string :url.
Methods inherited from JsonUiElement
Constructor Details
This class inherits a constructor from Glib::JsonUi::JsonUiElement
Instance Method Details
#url(value, options = {}) ⇒ Object
string :url
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/helpers/glib/json_ui/action_builder/windows.rb', line 22 def url(value, = {}) regex = /\/.+\.json|format=json/ if Rails.env.development? || Rails.env.test? && same_host?(value) raise "JSON url detected #{value}" if value.to_s.match?(regex) end if value.to_s.match?(regex) && Rails.env.production? && same_host?(value) Rollbar.error("JSON url detected #{value}") # value = value.gsub('.json', '') end instance_variable_set('@url', value) if [:cache] json.set! 'url', value end |