Rails (Ruby)
  • 20 Jun 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Rails (Ruby)

  • Dark
    Light
  • PDF

Article summary

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.png
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.png
  2. Restart your rails server and check your Prerender integration by following this guide.

Was this article helpful?

What's Next