Module: Glib::Json::Ui
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/controllers/concerns/glib/json/ui.rb
Instance Method Summary collapse
- #__json_ui_commit(options) ⇒ Object
- #__json_ui_start ⇒ Object
-
#form_authenticity_token ⇒ Object
Override.
- #json_ui_activated? ⇒ Boolean
-
#json_ui_url_options ⇒ Object
NOTE: Override default_url_options and call this method.
Instance Method Details
#__json_ui_commit(options) ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/concerns/glib/json/ui.rb', line 48 def __json_ui_commit() if @__json_ui_rendering if (hash = json_transformation_start).is_a?(Hash) case params[:_render] when 'v1' __json_ui_vue(hash, ) end end end end |
#__json_ui_start ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/concerns/glib/json/ui.rb', line 34 def __json_ui_start @__json_ui_activated = false @__json_ui_rendering = false if params[:_render].present? @__json_ui_activated = true request.variant = :ui if request.format.html? && params[:_skip_render] != 'true' @__json_ui_rendering = true request.format = 'json' end end end |
#form_authenticity_token ⇒ Object
Override
17 18 19 |
# File 'app/controllers/concerns/glib/json/ui.rb', line 17 def form_authenticity_token Rails.env.test? ? 'test_token' : super end |
#json_ui_activated? ⇒ Boolean
30 31 32 |
# File 'app/controllers/concerns/glib/json/ui.rb', line 30 def json_ui_activated? @__json_ui_activated end |
#json_ui_url_options ⇒ Object
NOTE: Override default_url_options and call this method
22 23 24 25 26 27 28 |
# File 'app/controllers/concerns/glib/json/ui.rb', line 22 def = {} [:_render] = params[:_render] [:_locale] = params[:_locale] [:format] = :json if request.format == :json end |