ethereal 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/lib/ethereal/railtie.rb +1 -4
- data/lib/ethereal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c42c99416c967e68ecbae780c286828dc77132f0
|
4
|
+
data.tar.gz: 34a89366675d5ac7cb08edd15e46234d14947ce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a08e7dae59c8b6286da5c18802d0bb308062ee033f151420584879290d13e091b31d3f96d65082982539a726e8de2844fc415fd935f47ceaefe83dda8d61d1b
|
7
|
+
data.tar.gz: d4cbad2a383d887de32f323b9d7e66603d8dad3cf977820a4469f13d9815aef2438eb9678c126b56d2b70d0a6106819ea48295cbb7a6f186619fdf8fa7097ccd
|
data/README.md
CHANGED
@@ -20,12 +20,14 @@ Then add this line to application.js
|
|
20
20
|
Ethereal is an event based framework that manages the life cycle of JavaScript objects. Here's a simple Todo where you can dynamically add/remove items on the list.
|
21
21
|
|
22
22
|
```erb
|
23
|
-
|
23
|
+
<!-- views/todos/index.html.erb -->
|
24
|
+
<%= content_tag :ol, as: 'Todo.List', do %>
|
24
25
|
<%= render @todos %>
|
25
26
|
<% end %>
|
26
27
|
```
|
27
28
|
|
28
29
|
```coffee
|
30
|
+
# assets/javascripts/todos/list.js.coffee
|
29
31
|
class Todos
|
30
32
|
# @element() always return the element to which your object is bound.
|
31
33
|
|
@@ -44,7 +46,7 @@ Ethereal.Models.add Todos, 'Todo.List'
|
|
44
46
|
|
45
47
|
```ruby
|
46
48
|
#views/todos/create.js.erb
|
47
|
-
e.html = "<%= j render
|
49
|
+
e.html = "<%= j render(@todo) %>".toHTML()
|
48
50
|
```
|
49
51
|
|
50
52
|
```ruby
|
@@ -59,6 +61,6 @@ Some notes:
|
|
59
61
|
- A callback (@loaded) is called right after Ethereal has instantiated an object.
|
60
62
|
- In *.js.erb, an event is created. You can set HTML to the event object.
|
61
63
|
- To ease the process, a toHTML() method has been added to the String object (JS).
|
62
|
-
- You need to register any class you create through the ```Ethereal.Models.add Class, 'name'
|
64
|
+
- You need to register any class you create through the ```Ethereal.Models.add Class, 'name'```. The name is the attribute you set in your DOM.
|
63
65
|
|
64
66
|
|
data/lib/ethereal/railtie.rb
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
module Ethereal
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
initializer 'ethereal.assets.paths', before: :add_view_paths do |app|
|
4
|
-
|
5
|
-
app.paths['vendor/assets'] << ethereal_assets_path
|
6
|
-
app.config.assets.precompile << ethereal_assets_path
|
7
|
-
|
4
|
+
app.paths['vendor/assets'] << File.dirname(__FILE__) + '/app/assets/'
|
8
5
|
app.paths['app/views'] << File.dirname(__FILE__) + '/app/views/'
|
9
6
|
end
|
10
7
|
end
|
data/lib/ethereal/version.rb
CHANGED