rao-component 0.0.17.pre → 0.0.18.pre
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1346f481258ff3da5a379054faf4ad155cc820a2e0a57ad32478301e930ebaed
|
4
|
+
data.tar.gz: 49cd24b2c52d42ae848dfdf524e4d8b16f0a12a1640b72df9db460c2c1b07590
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feb10b974cbedaa279b3771ef186774bf0dddd0419245ee46521278a6b7fd1b56f064e25a704e833fb5543a45aa3965afd356bd14c8c05b7eaa650551aa412ac
|
7
|
+
data.tar.gz: 442590f3803906eeb2bb8468e8c94d1561166c86e9059287e769e342c8d30cb24a2c91a7d2a88485d457b9f352ad14d53f794d162d404d7791548fcd6a4e1d79
|
@@ -1,11 +1,16 @@
|
|
1
1
|
module Rao
|
2
2
|
module Component
|
3
|
-
#
|
3
|
+
# Usage:
|
4
4
|
#
|
5
|
-
#
|
6
|
-
# = collection_table(collection: @pictures) do |table|
|
7
|
-
# = table.acts_as_published_actions
|
5
|
+
# Setup the model with acts_as_published:
|
8
6
|
#
|
7
|
+
# # app/models/picture.rb
|
8
|
+
# class Picture < ActiveRecord::Base
|
9
|
+
# include ActsAsPublished::ActiveRecord
|
10
|
+
# acts_as_published
|
11
|
+
# # ...
|
12
|
+
# end
|
13
|
+
|
9
14
|
# You will have to add a publishing route to your resource:
|
10
15
|
#
|
11
16
|
# # config/routes.rb:
|
@@ -26,6 +31,12 @@ module Rao
|
|
26
31
|
# # ...
|
27
32
|
# end
|
28
33
|
#
|
34
|
+
# Use the acts_as_published_actions macro in your collection table:
|
35
|
+
#
|
36
|
+
# # app/views/pictures/index.html.haml
|
37
|
+
# = collection_table(collection: @pictures) do |table|
|
38
|
+
# = table.acts_as_published_actions
|
39
|
+
#
|
29
40
|
module CollectionTable::ActsAsPublishedConcern
|
30
41
|
extend ActiveSupport::Concern
|
31
42
|
|
@@ -1,2 +1,6 @@
|
|
1
|
-
-
|
2
|
-
|
1
|
+
- if resource.send(name).present?
|
2
|
+
- begin
|
3
|
+
- image_html = options[:image_html] || { src: main_app.url_for(resource.send(name).variant(options[:variant_options])) }
|
4
|
+
- rescue ActiveStorage::InvariableError => e
|
5
|
+
- image_html = { src: main_app.url_for(resource.send(name)) }
|
6
|
+
%img{ image_html }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|