Rails (Ruby)
  • 15 Feb 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:

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

Was this article helpful?

What's Next