simple_show_helper 0.0.0 → 0.0.1
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.
- data/README.md +7 -7
- data/VERSION +1 -1
- data/lib/simple_show_helper.rb +6 -6
- metadata +10 -10
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
simple\_show\_helper
|
2
2
|
=======
|
3
3
|
|
4
4
|
Why?
|
@@ -7,32 +7,32 @@ Why?
|
|
7
7
|
It is intended to use with new Rails+Bootstrap apps to create as fast as possible 'show' pages.
|
8
8
|
You only have to add one line to view which will describe model instance + it references.
|
9
9
|
|
10
|
-
I use this tool here https://github.com/akwiatkowski/waypoint_manager/blob/master/app/views/areas/show.html.haml
|
10
|
+
I use this tool here [https://github.com/akwiatkowski/waypoint_manager/blob/master/app/views/areas/show.html.haml](https://github.com/akwiatkowski/waypoint_manager/blob/master/app/views/areas/show.html.haml)
|
11
11
|
|
12
12
|
How to?
|
13
13
|
-----
|
14
14
|
|
15
15
|
Add line in view
|
16
16
|
|
17
|
-
=
|
17
|
+
> = raw simple_show_helper(User.first)
|
18
18
|
|
19
19
|
Keep in mind that it uses only locales in format for example: 'en.user.email'
|
20
20
|
|
21
21
|
Custom attributes:
|
22
22
|
|
23
|
-
|
23
|
+
> = raw simple_show_helper(User.first, attrs: ["email", "name"])
|
24
24
|
|
25
25
|
Add created_at, updated_at attributes:
|
26
26
|
|
27
|
-
|
27
|
+
> = raw simple_show_helper(User.first, timestamps: true)
|
28
28
|
|
29
29
|
Custom table class, for not Bootstrap users:
|
30
30
|
|
31
|
-
|
31
|
+
> = raw simple_show_helper(User.first, table_class: "table")
|
32
32
|
|
33
33
|
All options example:
|
34
34
|
|
35
|
-
raw
|
35
|
+
> = raw simple_show_helper(resource, attrs: ["name"], timestamps: true, table_class: "table")
|
36
36
|
|
37
37
|
|
38
38
|
Spec, tests, ...
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/lib/simple_show_helper.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
module ApplicationHelper
|
2
2
|
# Usage:
|
3
3
|
# use in view with bootstrap
|
4
|
-
# =
|
4
|
+
# = simple_show_helper(User.first)
|
5
5
|
#
|
6
6
|
# Keep in mind:
|
7
7
|
# * it uses only locales in format like this 'en.user.email'
|
8
8
|
#
|
9
9
|
# Custom attributes:
|
10
|
-
# =
|
10
|
+
# = simple_show_helper(User.first, attrs: ["email", "name"])
|
11
11
|
# Add created_at, updated_at:
|
12
|
-
# =
|
12
|
+
# = simple_show_helper(User.first, timestamps: true)
|
13
13
|
# Custom table class
|
14
|
-
# =
|
14
|
+
# = simple_show_helper(User.first, table_class: "table")
|
15
15
|
#
|
16
16
|
# Example:
|
17
|
-
#= raw
|
17
|
+
#= raw simple_show_helper(resource, attrs: ["name"], timestamps: true, table_class: "table")
|
18
18
|
|
19
|
-
def
|
19
|
+
def simple_show_helper(m, options = { })
|
20
20
|
if options[:table_class]
|
21
21
|
table_class = options[:table_class]
|
22
22
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_show_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-11-15 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &20354140 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.3.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *20354140
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &20353580 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *20353580
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &20353060 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *20353060
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simplecov
|
49
|
-
requirement: &
|
49
|
+
requirement: &20352540 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *20352540
|
58
58
|
description: Simple helper to create 'show' pages easily.
|
59
59
|
email: bobikx@poczta.fm
|
60
60
|
executables: []
|
@@ -85,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
segments:
|
87
87
|
- 0
|
88
|
-
hash:
|
88
|
+
hash: 50637960428732025
|
89
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
90
|
none: false
|
91
91
|
requirements:
|