Skip to content

Commit 6cfcc41

Browse files
committed
update readme
1 parent f24b667 commit 6cfcc41

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# React-Router-Vite-Rails
22

3-
This is an example web application that proposes a way to integrate React Router Framework/SPA mode and Ruby on Rails.
3+
This is an example web application that proposes a way to integrate React Router Framework/SPA mode with Ruby on Rails.
44

55
Consider using the methods in this example
6-
to explore a simple way to create a better React SPA integration for Ruby on Rails.
6+
to explore a simple way to create a better React SPA Rails integration.
77

8-
[Jump to how to build it](#how-it-is-built)
9-
[See this example app deployed using Kamal](https://rrrails.castle104.com)
8+
- [Jump to read how to build it](#how-it-is-built)
9+
- [See this example app deployed using Kamal](https://rrrails.castle104.com)
1010

1111
## The problem
1212

@@ -59,8 +59,8 @@ Note that you can use Next.js [with static exports](https://nextjs.org/docs/app/
5959
to generate files that can be statically hosted as an SPA.
6060
You could put these on a Ruby on Rails `public` folder to achieve simplicity that is similar to the current approach.
6161
However, Next.js static exports have difficulties, particularly with dynamic routes,
62-
which make it a less straightforward than React Router v7 in SPA mode.
63-
Hence, my choice of React Router v7 instead.
62+
which make it less straightforward than React Router v7 in SPA mode.
63+
Hence, my choice of React Router v7 for this example.
6464

6565
## Building the Integration
6666

@@ -72,7 +72,7 @@ The step-by-step setup is as follows.
7272
### Install Ruby on Rails
7373

7474
Just run `rails new` to set up the Ruby on Rails server.
75-
The default, no-build setup will suffice since Rails is not responsible for building the React application.
75+
The default, no-build setup will suffice since Rails is not responsible for building the React Router application.
7676
If you want, you can use [jsbundling](https://github.com/rails/jsbundling-rails) for additional JavaScript.
7777
Note that the React Router app will be completely independent of jsbundling.
7878

@@ -149,12 +149,14 @@ To understand the benefits of using an SPA framework, I believe that you need to
149149

150150
### Authentication
151151

152-
Running React as a static asset on a Ruby on Rails application makes authentication simple. To illustrate this,
152+
Running React as a static asset on a Ruby on Rails application makes it possible to share cookies,
153+
and this greatly simplifies authentication.
154+
To illustrate this,
153155
I have created a simple session-based authentication system in Rails and have used it from the React application.
154156

155157
Note that the ERB and the React pages will share authentication.
156-
This makes it particularly easy to mix React and ERB pages in the same application
157-
if you are gradually transitioning from a React-based site to Hotwire, for example.
158+
This makes it particularly easy to mix React and ERB pages in the same application.
159+
This helps a lot if you are gradually transitioning from a React-based site to Hotwire, for example.
158160

159161
### CSRF protection
160162

0 commit comments

Comments
 (0)