Skip to content

Web component/JSX-like syntax #1204

Closed Answered by camertron
DanielJackson-Oslo asked this question in Ideas
Discussion options

You must be logged in to vote

@DanielJackson-Oslo to add to what @joelhawksley mentioned, rux works inside any Ruby file with a .rux extension, but can also be used inside your templates if you use the special .ruxt extension (i.e. component_name.html.ruxt). You still have to use the render ComponentName.new syntax outside of the component, but inside <ComponentName ...> works as expected. You could, for example, create a top-level Layout component or something, render it with the .new syntax, then use rux everywhere else. One caveat tho: rux supports the slots API, but not very nicely, so your mileage may vary.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@DanielJackson-Oslo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by joelhawksley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants