run_simple_render 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 833966d0efcb0d59e0a39cdc6eb46c2206083e3f
4
- data.tar.gz: cd82ada654c19361de37630466a6e45dffc9b2bc
3
+ metadata.gz: 1716e5a1f6d3f78d56fd57dc7997b1c3b86be355
4
+ data.tar.gz: 1438daf4426e5041b75d9e170295a18b32bbe461
5
5
  SHA512:
6
- metadata.gz: 8221a3cb304eb0dbd2a8570b8481cb0ad476e527039dbd76114e072489dad501796a4b43ebecac4918f261a6513fe1d0620e1819522df0e679be777294e55442
7
- data.tar.gz: bf14cf69fa78874a7c7018a5b6df2eba9b7f5081ac107b9e269247f25fe2af36a9cd8c60e0e8d20bfca7c66459a5f8324fae52d9cbb703ae9cb7fca82f73d2ba
6
+ metadata.gz: 363ea4b56d72ad8169af5179fb5942b924ea78056bd8bd618c59838ad6e1d55a4f0d26683371c78b130faa5a28cb23a122a4eb217eeb5bf19e8e4434798b986d
7
+ data.tar.gz: 1a49d81d5da075ca2757e163e252dbcf51eb3bd06fa47d40c73a2dc7342c835883d8157fac474d2f31df265e77c9a1943d571053cb3fab1c7235e5a58362b646
data/README.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # RunSimpleRender
2
2
 
3
- Simple approach to have an powerful presentation
3
+ Simple approach to have a more powerful presentation in rails.
4
+
5
+ The idea behind this gem is to be able to tie models to the appropriate
6
+ views for the maximun reusability while **avoiding**:
7
+
8
+ a. helpers with inline html
9
+
10
+ b: creation of additional classes (with more html within the methods)
11
+
12
+ c. bloating the models with presentation methods (bad practice)
13
+
14
+ d. a learning curve (this is extremely easy to use)
15
+
4
16
 
5
17
  ## Installation
6
18
 
@@ -31,7 +43,7 @@ A. Include RunSimpleRender in the model
31
43
  B. Create your model views under a folder called renditions
32
44
 
33
45
 
34
- $ /views/renditions/[modelname]/
46
+ $ /views/renditions/[modelname]/
35
47
 
36
48
 
37
49
  ex. /views/renditions/user/default.html.erb:
@@ -58,13 +70,13 @@ C. Render the appropriate view as needed and were needed
58
70
 
59
71
  ## More
60
72
 
61
- You can also call relate models
73
+ You can also call related models
62
74
 
63
75
  @usr = User.find(1)
64
76
 
65
77
  @usr.company.render(:short_description)
66
78
 
67
- Or render collection from the view ex. /views/renditions/company/all_users.html.erb:
79
+ Or render a collection from the view ex. /views/renditions/company/all_users.html.erb:
68
80
 
69
81
  Company: <%= obj.name %>
70
82
 
@@ -79,3 +91,5 @@ Or render collection from the view ex. /views/renditions/company/all_users.html
79
91
  ## Contributing
80
92
 
81
93
  Coming soon!!
94
+
95
+
@@ -1,3 +1,3 @@
1
1
  module RunSimpleRender
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -15,7 +15,7 @@ module RunSimpleRender
15
15
  end
16
16
  template_path = template_path.underscore
17
17
  begin
18
- ApplicationController.new.render_to_string(template: template_path, locals:{obj: self, args: args}, layout: false).html_safe
18
+ ApplicationController.new.render_to_string(template: template_path, locals:{ obj: self, args: args}, layout: false).html_safe
19
19
  #Call the parent if not let it fail
20
20
  rescue ActionView::MissingTemplate
21
21
  puts "Warning: [#{self.class.name}] did not have #{template_path} defined. Trying the parent [#{self.class.base_class.name}]"
@@ -23,7 +23,7 @@ module RunSimpleRender
23
23
  template_path = template_path.split('/')
24
24
  template_path.delete_at(2)
25
25
  template_path = template_path.join('/')
26
- ApplicationController.new.render_to_string(template: template_path,locals:{obj: self}, layout: false).html_safe
26
+ ApplicationController.new.render_to_string(template: template_path,locals:{ obj: self}, layout: false).html_safe
27
27
  end
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_simple_render
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Iriso