我想使用:
class UserDetails < HyperComponent
param :user
render do
H1 { user.name }
end
代替
class UserDetails < HyperComponent
param :user
render do
H1 { @User.name }
end
如何将其设为默认值?
答案 0 :(得分:1)
class HyperComponent
include Hyperstack::Component
include Hyperstack::State::Observable
param_accessor_style :accessors # this is now the prefered param style
end