You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 19, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,17 +72,24 @@ $ rails g gor development
72
72
73
73
here we use the `development` environment to generate a `go_app` directory in our Rails project root.
74
74
75
-
and don't forget to install Go packages our app depends:
75
+
and don't forget to install Go packages our app depends on by running a predefined Rake task:
76
76
77
77
```bash
78
78
$ rails gor:deps
79
79
```
80
80
81
+
and we also need some other Go packages in this example, we can install them in advance:
82
+
83
+
```bash
84
+
go get github.com/bitly/go-simplejson
85
+
go get github.com/goonr/gorails/...
86
+
```
87
+
81
88
### Create a controller to read Rails session
82
89
83
90
Now we'll write an API to read Rails session. First let's create a contoller as `go_app/controllers/sessions_controller.go`.
84
91
85
-
And here we use a package [gorails](https://github.com/goonr/gorails) to read the session. Please check the [sessions_controller](https://github.com/goonr/example_read_rails_session/blob/master/go_app/controllers/sessions_controller.go) for the details. We can install it by `go get github.com/goonr/gorails`.
92
+
And here we use a package [gorails](https://github.com/goonr/gorails) to read the session. Please check the [sessions_controller](https://github.com/goonr/example_read_rails_session/blob/master/go_app/controllers/sessions_controller.go) for the details.
86
93
87
94
After set a route in the `main.go`, we can set up our Go server to read the Rails session:
0 commit comments