Rack offline

Let’s do some interesting stuff. Today we are going to offline the single page of a web application. For this, we will use Rack offline in Ruby on Rails version 4.


Installation and configuration

To install write

$gem install ‘rack-offline’

then open Gemfile and add

gem ‘rack-offline’


after that open config/routes.rb file and add

match “/application.manifest”=>Rails::Offline,:via=>[:get], :as=> :manifest

then open view/layouts/aaplication.html.erb

<html lang=’en’ manifest=’/fr/application.manifest’>

and then Run the server using

$rails server

and here’s you are done. 🙂 your web page will work offline.