Building on Archonic's and Elena's Answers, the reload function accepts a parameter to force the page to reload from the server aka forceGet, instead of from cache. A parameter can be set by the controller logic, like successful or failed login of a user, to trigger the desired behavior when it is sent to the page.
# force_get = controller_logic ? true : false
respond_to do |format|
format.js { render inline: "location.reload(#{force_get});" }
end
UPDATE:
the logic has been deprecated for the forceGet option. If you do want to reload from the server you can use this logic:
# force_get = controller_logic ? true : false
respond_to do |format|
format.js { render inline: force_get ? "window.location.href = window.location.href;" : "location.reload();" }
end