Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render objects in Ruby templates #169

Merged
merged 14 commits into from
Oct 29, 2020
Merged

Render objects in Ruby templates #169

merged 14 commits into from
Oct 29, 2020

Conversation

jaredcwhite
Copy link
Member

@jaredcwhite jaredcwhite commented Oct 22, 2020

In a similar vein to recent changes in Rails, this adds a render method for Ruby-based templates that either calls the existing partial method, or alternatively calls the render_in method of an object that's passed. This lets you do:

<%= render Something.new %>

I also added Zeitwerk loading to facilitate Ruby files within the component folders (src/_components as well as any gems which provide a components folder via a source manifest).

Hmm…could this mean…will this…?? Let's just say this enables a much bigger announcement in the near future. 😎

Also includes an improved capture ERB helper as well a fix for #72. In addition, typical "Rails-style" block expressions (aka <%= whatever do %>…<% end %>) now work as expected.

  • Tests
  • Documentation

@jaredcwhite jaredcwhite added the enhancement New feature or request label Oct 22, 2020
@jaredcwhite jaredcwhite added this to the 0.18.0 "Taylor Street" milestone Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant