Sha256: 8c5835c4f2c4fc0dee521bfe90dce8229600b382e90af6c883172521ab73146f

Contents?: true

Size: 687 Bytes

Versions: 1

Compression:

Stored size: 687 Bytes

Contents

# Rack::LocaleRootRedirect

`Rack::LocaleRootRedirect` redirects requests to `"/"` based on the `Accept-Language` HTTP header.

## Installation

Add this line to your application’s Gemfile:

```ruby
gem 'rack-locale-root-redirect'
```

And then execute:

```shell
$ bundle
```

## Usage

With Sinatra:

```ruby
# Gemfile
gem "sinatra"
gem "rack-accept", :require => "rack/accept"
gem "rack-locale-root-redirect", :require => "rack/locale-root-redirect"

# config.ru
require 'bundler'
Bundler.require

class MyApp < Sinatra::Base
  use Rack::Accept
  use Rack::LocaleRootRedirect, :fr => "/fr", :en => "/en"

  get("/fr") { "Français!" }
  get("/en") { "English!" }
end

run MyApp
```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-locale-root-redirect-0.0.1 README.md