1. Knowledgebase - Prerender
  2. Integrations
  3. Prerender.io officially maintained integration

Rails (Ruby)

This guide will walk you through integrating Prerender into your Rails server, improving your SEO.

View source on GitHub

Video guide:

Prerender token

The location of the Prerender token has changed. You can find it under the Security and Access menu under Prerender Token.

You can find the required codes in the text guide.

Text guide:

  1. Navigate to your project's root directory. e.g.: /home/rails/example/
  2. Add the middleware gem by inserting the line below into you project's Gemfile.
    Usually located at /<project root directory>/Gemfile
    image(67)
gem 'prerender_rails'
  1. Then add the line below to your production config file usually located at
    /<project root directory>/config/environments/production.rb.
 config.middleware.use Rack::Prerender, prerender_token: 'YOUR_TOKEN'
  1. Make sure to replace the YOUR_TOKEN place holder with your Prerender.io Token from the Security and Access menu
    image(68)
  2. Restart your rails server and check your Prerender integration by following this guide.