Sha256: 0e59146c2e88e95b0b053bf47ae7947bfa162efaaeca45f73b27ea21161a437a

Contents?: true

Size: 436 Bytes

Versions: 12

Compression:

Stored size: 436 Bytes

Contents

module Rad::ControllerMicelaneousHelper
  def reload_page
    params = workspace.params
    params.format.must_be.in 'html', 'js'
    
    keep_flash!      
    if params.format == 'js'
      workspace.response.set!(
        status: :ok, 
        content_type: Mime[params.format]
      )
      throw :halt, "window.location.reload();"
    else
      redirect_to workspace.request.env["HTTP_REFERER"]
    end              
  end    
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rad_core-0.0.25 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.24 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.23 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.22 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.21 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.20 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.19 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.18 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.17 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.16 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.15 lib/rad/core_web/_controller_micelaneous_helper.rb
rad_core-0.0.14 lib/rad/core_web/_controller_micelaneous_helper.rb