Mike Coutermarsh
  • Home
  • About
  • Twitter
  • GitHub
Sign in Subscribe

Grape/Rails API Cross-Origin Resource Sharing

  • Mike Coutermarsh

Mike Coutermarsh

Dec 16, 2012

If you want to allow access to your Grape API from other domains, you need to implement CORS!

It’s easy with the rack-cors gem. Here’s how you do it.

Add rack-cors to your gemfile.

gem 'rack-cors', :require => 'rack/cors'

Then go to your application.rb and add:

[gist id="4297940"]https://gist.github.com/4297940

done!

Get notified of new posts

Enter your email
Subscribe

AstroVim slow on large files

If you're finding AstroVim is lagging on very large files, it is possible the source of the problem is vim-illuminate. To determine if it is, run :TSDisable illuminate. Does it solve your problem? Large file cutoff If that solved your problem, you can disable illuminate for large files
Apr 19, 2024

How to use GitHub Copilot with AstroVim 4

This took me a while to figure out. In this file: ~/.config/nvim/lua/community.lua You need to add the following line. { import = "astrocommunity.completion.copilot-lua-cmp" }, Then, when you start nvim again. Run :Copilot auth. This will trigger the setup and you'll be good to
Apr 16, 2024

How high scale Rails apps make schema changes

I recently wrote a post over on the PlanetScale blog sharing how we make schema changes for our own Rails app. In the post I share a couple concepts that might be new to you. 1. "Online" schema change tools 2. Separating rails db:migrate from deploys If
Apr 7, 2024
Mike Coutermarsh © 2025
  • HTML/CSS to Image API
  • Twitter
  • GitHub
  • LinkedIn