rao-component 0.0.17.pre → 0.0.18.pre

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
  SHA256:
3
- metadata.gz: 17d94e6e904c7ce09d5279c5f7250c8e346272fbcb7351f139adf3ab2686b6d8
4
- data.tar.gz: ac5f7585306e5697700d433064ec062ee34ac06cd36585313584538b64affe80
3
+ metadata.gz: 1346f481258ff3da5a379054faf4ad155cc820a2e0a57ad32478301e930ebaed
4
+ data.tar.gz: 49cd24b2c52d42ae848dfdf524e4d8b16f0a12a1640b72df9db460c2c1b07590
5
5
  SHA512:
6
- metadata.gz: 45529a01ca581a7f43124152189695e6999fb787035cf2d53bef4cd629947d0fbdbe0ea393b0e0dce74984b9e75fcc8f5bca570c592894d08d7fb70c110345c8
7
- data.tar.gz: 55458568c6eb9ccdad01a5c086c12202b5cf17d20269a9dbacb83d962cd8b64f4e41768063d1af76dde85e0d3605d8460f1701ca5f74b79103347e3220dffaf4
6
+ metadata.gz: feb10b974cbedaa279b3771ef186774bf0dddd0419245ee46521278a6b7fd1b56f064e25a704e833fb5543a45aa3965afd356bd14c8c05b7eaa650551aa412ac
7
+ data.tar.gz: 442590f3803906eeb2bb8468e8c94d1561166c86e9059287e769e342c8d30cb24a2c91a7d2a88485d457b9f352ad14d53f794d162d404d7791548fcd6a4e1d79
@@ -1,11 +1,16 @@
1
1
  module Rao
2
2
  module Component
3
- # Basic usage:
3
+ # Usage:
4
4
  #
5
- # # app/views/pictures/index.html.haml
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
- - image_html = options[:image_html] || { src: main_app.url_for(resource.send(name).variant(options[:variant_options])) }
2
- %img{ image_html }
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.17.pre
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-01 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails