Sha256: 9503b70dc3ebd322e49301544767e5a398843b6b90108f3fe19ade7186b43ff3

Contents?: true

Size: 428 Bytes

Versions: 12

Compression:

Stored size: 428 Bytes

Contents

module Rad::ControllerMiscellaneousHelper
  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 request.env["HTTP_REFERER"]
    end              
  end    
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rad_core-0.2.6 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.2.5 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.2.4 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.2.3 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.2.2 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.2.1 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.2.0 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.0.30 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.0.29 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.0.28 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.0.27 lib/rad/web/_controller_miscellaneous_helper.rb
rad_core-0.0.26 lib/rad/web/_controller_miscellaneous_helper.rb