rails_view_component 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4f4690f3c89bdc96ee2037c670ea671de3381c1
|
4
|
+
data.tar.gz: 9d6656809d7b0a21d236c1b6b1a703c1e892a6b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5017de8faa43b82f91a77006374272ecb34ef5cfe414950a6ef55602dcd1acc1846304d8ab32ac9e6868873d9280771f7ce4c735bd741d4d70472076f4feab2
|
7
|
+
data.tar.gz: dca47336c4f93393d738363309a83ec8af94211fb0bcaa04f039c4d457b10aa4b857a8a26983ec63a980cafd887a5f5dcf0af068efde090aafcafa08f78eab6c
|
@@ -3,14 +3,14 @@ class RailsViewComponentBuilder
|
|
3
3
|
@count = 0
|
4
4
|
@components = []
|
5
5
|
end
|
6
|
-
def destribute name,
|
6
|
+
def destribute name, ajax_params = {}, erb_params={}
|
7
7
|
namespace = name.to_s.camelize
|
8
8
|
name = namespace.split("::").last
|
9
9
|
@count += 1
|
10
10
|
klass = Module.const_get("#{namespace}::#{name}Model")
|
11
11
|
obj = klass.new @count
|
12
12
|
@components.push obj
|
13
|
-
obj.html(
|
13
|
+
obj.html(ajax_params, erb_params).html_safe
|
14
14
|
end
|
15
15
|
|
16
16
|
def all_javascripts
|
@@ -20,7 +20,7 @@ class RailsViewComponentModel
|
|
20
20
|
[]
|
21
21
|
end
|
22
22
|
|
23
|
-
def html
|
23
|
+
def html ajax_params={}, erb_params={}
|
24
24
|
action_view = ActionView::Base.new "#{Rails.root}/app/rails_view_components/#{@dir}/views"
|
25
25
|
erb_params.each{|k,v| action_view.assign(k=>v) }
|
26
26
|
ajax_params.each{|k,v| action_view.assign(k=>v) }
|