superview 1.0.0 → 1.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/superview/actions.rb +13 -4
- data/lib/superview/components/table_component.rb +1 -1
- data/lib/superview/helpers/turbo/meta_tags.rb +1 -1
- data/lib/superview/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf2d8ead19d68999eccbddbbfa0ea8b93ef447588c28f202d326d74044658168
|
4
|
+
data.tar.gz: 6812b0c74b9940484b547439da76a7bba4b7286ada32bd9a5144a1f71bace544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c9582849a4511fc9b23f049adee0f04a9a3b53837cdaf4621475d27e8757f2e1158482318871269c6b74684faf75778ef11f478830bd5a172de290586601308
|
7
|
+
data.tar.gz: 659e0d17f9ac6c335438fb42040c24817ba0313b29f9a0610cb83e0f2daf44d7c01b50ff90f2f29292229fb35d6e6ae6b23f521714a3c8c9d909c32dc65e9ade
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ class PostsController < ApplicationController
|
|
9
9
|
|
10
10
|
before_action :load_post
|
11
11
|
|
12
|
-
class Show <
|
12
|
+
class Show < Components::Base
|
13
13
|
attr_accessor :post
|
14
14
|
|
15
15
|
def view_template(&)
|
@@ -78,7 +78,7 @@ class PostsController < ApplicationController
|
|
78
78
|
|
79
79
|
before_action :load_post
|
80
80
|
|
81
|
-
class Show <
|
81
|
+
class Show < Components::Base
|
82
82
|
attr_accessor :post
|
83
83
|
|
84
84
|
def view_template(&)
|
@@ -120,7 +120,7 @@ class PostsController < ApplicationController
|
|
120
120
|
|
121
121
|
# Your code...
|
122
122
|
|
123
|
-
class Show <
|
123
|
+
class Show < Components::Base
|
124
124
|
attr_accessor :post
|
125
125
|
|
126
126
|
def view_template(&)
|
@@ -186,7 +186,7 @@ First let's extract the `Show` class into `./app/views/posts/show.rb`
|
|
186
186
|
```ruby
|
187
187
|
# ./app/views/posts/show.rb
|
188
188
|
module Posts
|
189
|
-
class Show <
|
189
|
+
class Show < Components::Base
|
190
190
|
attr_accessor :post
|
191
191
|
|
192
192
|
def view_template(&)
|
data/lib/superview/actions.rb
CHANGED
@@ -13,7 +13,7 @@ module Superview
|
|
13
13
|
#
|
14
14
|
# before_action :load_post
|
15
15
|
#
|
16
|
-
# class Show <
|
16
|
+
# class Show < Phlex::HTML
|
17
17
|
# attr_accessor :post
|
18
18
|
#
|
19
19
|
# def view_template(&)
|
@@ -90,9 +90,18 @@ module Superview
|
|
90
90
|
# If it resolves a Phlex class in the controller, it will render that. If it's
|
91
91
|
# not found it continues with Rails method of resolving action names.
|
92
92
|
def method_for_action(action_name)
|
93
|
-
super
|
94
|
-
|
95
|
-
|
93
|
+
# Yep. `super` calls this, but we have to call it here to cover the
|
94
|
+
# situation where the person uas a `./app/views/users/*.rb` file with a Ruby
|
95
|
+
# class in it that might be included in the controller via `include Views::Users`.
|
96
|
+
# If we call super first, it will tink that `./app/views/users/show.rb` is a template
|
97
|
+
# and raise an error that it doesn't have a format.
|
98
|
+
if action_method?(action_name)
|
99
|
+
action_name
|
100
|
+
elsif component_action_exists? action_name
|
101
|
+
"default_component_render"
|
102
|
+
else
|
103
|
+
super
|
104
|
+
end
|
96
105
|
end
|
97
106
|
|
98
107
|
# Renders a Phlex view for the given action, if it's present.
|
data/lib/superview/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Gessler
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-
|
10
|
+
date: 2025-10-03 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: zeitwerk
|
@@ -91,7 +90,6 @@ metadata:
|
|
91
90
|
homepage_uri: https://github.com/rubymonolith/superview
|
92
91
|
source_code_uri: https://github.com/rubymonolith/superview
|
93
92
|
changelog_uri: https://github.com/rubymonolith/superview
|
94
|
-
post_install_message:
|
95
93
|
rdoc_options: []
|
96
94
|
require_paths:
|
97
95
|
- lib
|
@@ -106,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
104
|
- !ruby/object:Gem::Version
|
107
105
|
version: '0'
|
108
106
|
requirements: []
|
109
|
-
rubygems_version: 3.
|
110
|
-
signing_key:
|
107
|
+
rubygems_version: 3.6.2
|
111
108
|
specification_version: 4
|
112
109
|
summary: Build Rails applications entirely from Phlex, ViewComponents, or any object
|
113
110
|
that responds to `#render_in`
|