Skip to content
Permalink
Browse files
Setup Rails to Serve the HTML Generated by Webpack
  • Loading branch information
leonelgalan committed Mar 2, 2020
1 parent a8fad1d commit 6ff32b0388e3044a51b443b68750fec4fddfae57
Showing 3 changed files with 16 additions and 1 deletion.
@@ -0,0 +1,5 @@
class PagesController < ActionController::Base
def index
render file: 'public/packs/index.html'
end
end
@@ -1,3 +1,4 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root 'pages#index', as: :pages_index
get '*path', to: 'pages#index'
end
@@ -0,0 +1,9 @@
require 'test_helper'

class PagesControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get pages_index_url
assert_response :success
end

end

0 comments on commit 6ff32b0

Please sign in to comment.