Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Add hint for rails 5 users #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ end
```
Note that with Reactive Record ` @posts = Post.all` is set in `before_mount` whereas if you were using a a REST based `GET` you would have done so in `after_mount`. Setting the value of `@posts` in `before_mount` means you do not have to worry about nil values while prerendering. The actual query to the server is not initiated at this stage, but when the component is rendering.

### Rails 5
In Rails 5 all models suppose to derive from `ApplicationRecord`. Consequently `ApplicationRecord` has to be present in `app/models/public`.

```ruby
# app/models/public/application_record.md
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

```
## Live updates via Synchromesh

[Synchromesh](https://github.com/reactrb/synchromesh) if fully integrated with Reactive Record. Changes in records are broadcast (after filtering for security) to the clients and Reactrb updates the page if and only if the user is viewing a component containing data that has changed.
Expand Down