render_async 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -6
- data/lib/render_async/version.rb +1 -1
- metadata +2 -5
- data/.gitmodules +0 -4
- data/LICENSE.txt +0 -22
- data/lib/render_async/view_helpers.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c70691a62b5d47023c92ed34bf99fa601a2225a
|
4
|
+
data.tar.gz: dfd318ae355aae16e66cb6f54f3f278a6fe3acbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57655b60c806ca621cb2cd8e5be2084cf1c94293de75aeac3db279e8df6d5422ba2e7fdc06494c410b0cbec60a8b8aded087b92615df14883f596c625cd4af0e
|
7
|
+
data.tar.gz: eff5ef88ea6b2dd12f881c627d1a56d94d00289ef624069f25a0f536b8e4dddfaf772da85cc807afc42b594eaaadb18df81425027cb3418d7d2f6eb38d8f44e7
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
[![Build Status](https://semaphoreci.com/api/v1/renderedtext/render_async/branches/master/
|
1
|
+
[![Build Status](https://semaphoreci.com/api/v1/renderedtext/render_async/branches/master/shields_badge.svg)](https://semaphoreci.com/renderedtext/render_async)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/render_async.svg)](https://badge.fury.io/rb/render_async)
|
2
3
|
|
3
|
-
|
4
|
+
![render_async](https://semaphoreci.com/blog/assets/images/2017-06-08/speed-up-rendering-rails-pages-with-render-async-6c40eb39.png)
|
5
|
+
|
6
|
+
# render_async
|
4
7
|
|
5
8
|
Renders partials to your views **asynchronously**. This is done through adding
|
6
9
|
Javascript code that does AJAX request to your controller which then renders
|
@@ -32,7 +35,7 @@ And then execute:
|
|
32
35
|
|
33
36
|
1. Include `render_async` view helper somewhere in your views:
|
34
37
|
|
35
|
-
```
|
38
|
+
```erb
|
36
39
|
# app/views/comments/show.html.erb
|
37
40
|
|
38
41
|
<%= render_async comment_stats_path %>
|
@@ -52,12 +55,12 @@ And then execute:
|
|
52
55
|
def comment_stats
|
53
56
|
@stats = Comment.get_stats
|
54
57
|
|
55
|
-
render :
|
58
|
+
render :partial => "comment_stats"
|
56
59
|
end
|
57
60
|
```
|
58
61
|
|
59
62
|
4. Create a partial that will render
|
60
|
-
```
|
63
|
+
```erb
|
61
64
|
# app/views/comments/_comment_stats.html.erb
|
62
65
|
|
63
66
|
<div class="col-md-6">
|
@@ -66,7 +69,7 @@ And then execute:
|
|
66
69
|
```
|
67
70
|
|
68
71
|
5. Add `content_for` in your base view file
|
69
|
-
```
|
72
|
+
```erb
|
70
73
|
# application.html.erb
|
71
74
|
|
72
75
|
<%= content_for :render_async %>
|
data/lib/render_async/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_async
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Grubbe
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -61,11 +61,9 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- ".gitignore"
|
64
|
-
- ".gitmodules"
|
65
64
|
- ".rspec"
|
66
65
|
- Gemfile
|
67
66
|
- LICENSE
|
68
|
-
- LICENSE.txt
|
69
67
|
- README.md
|
70
68
|
- Rakefile
|
71
69
|
- app/views/render_async/_render_async.html.erb
|
@@ -75,7 +73,6 @@ files:
|
|
75
73
|
- lib/render_async/engine.rb
|
76
74
|
- lib/render_async/version.rb
|
77
75
|
- lib/render_async/view_helper.rb
|
78
|
-
- lib/render_async/view_helpers.rb
|
79
76
|
- render_async.gemspec
|
80
77
|
homepage: https://github.com/renderedtext/render_async
|
81
78
|
licenses:
|
data/.gitmodules
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2013 Kasper Grubbe
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'securerandom'
|
2
|
-
|
3
|
-
module RenderAsync
|
4
|
-
module ViewHelpers
|
5
|
-
def render_async(path)
|
6
|
-
container_name = "render_async_#{SecureRandom.hex(5)}#{Time.now.to_i}"
|
7
|
-
|
8
|
-
render 'render_async/render_async', {:container_name => container_name, :path => path}
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|