Rack::Unscripted
This is a small piece of Rack middleware that will append a message to your HTML warning a user that they need to enable JavaScript in order to properly view your site.
The Rack middleware will append a The div that is created can be referenced in CSS the the id, rack-unscripted-no-javascript-warning, so you can style this warning (when it does get displayed) to your heart's content. Original HTML: HTML with Rack::Unscripted enabled: Make sure to install this gem: or, add the following to your Gemfile: Then you need to configure your middleware stack to use this library. or In config/initializers/rack_unscripted.rb In config/environment.rbExample
Installation
gem install rack-unscripted
gem 'rack-unscripted'
Usage
use Rack::Unscripted
use Rack::Unscripted, "Custom warning message to users without JavaScript enabled."
Example Configuration
Rails 3.x
MyApplicationName::Application.config.middleware use "Rack::Unscripted"
Rails 2.3.x
config.middleware.use "Rack::Unscripted"
Sinatra
require 'rack/unscripted'
use Rack::Unscripted