Skip to content

Instantly share code, notes, and snippets.

@hpjaj
Created November 14, 2018 15:27
Show Gist options
  • Save hpjaj/19622660c16361d87279106e83aa01a9 to your computer and use it in GitHub Desktop.
Save hpjaj/19622660c16361d87279106e83aa01a9 to your computer and use it in GitHub Desktop.
# config/routes.rb
Rails.application.routes.draw do
root 'pages#index'
namespace :api, defaults: { format: 'json' } do
resources :posts, only: :index
end
# IMPORTANT #
# This `match` must be the *last* route in routes.rb
match '*path', to: 'pages#index', via: :all
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment