Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

update for "around_filter is deprecated and will be removed in Rails 5.1" #39

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ Hypernova.configure do |config|
end
```

In your controller, you‘ll need an `:around_filter` so you can opt into Hypernova rendering of view partials.
In your controller, you‘ll need an `:around_action` so you can opt into Hypernova rendering of view partials.

```ruby
class SampleController < ApplicationController
around_filter :hypernova_render_support
around_action :hypernova_render_support
end
```
Use `:around_filter` instead of `:around_action` if you using version 3.2.13 or older.

And then in your view we `render_react_component`.

Expand Down
2 changes: 1 addition & 1 deletion examples/simple/app/controllers/welcome_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class WelcomeController < ApplicationController
around_filter :hypernova_render_support
around_action :hypernova_render_support
def index
end
end
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function decode(res) {
}

function makeValidDataAttribute(attr, value) {
const encodedAttr = attr.toLowerCase().replace(/[^0-9a-z_\-]/g, '');
const encodedAttr = attr.toLowerCase().replace(/[^0-9a-z_-]/g, '');
const encodedValue = value.replace(/&/g, '&amp;').replace(/"/g, '&quot;');
return `data-${encodedAttr}="${encodedValue}"`;
}
Expand Down