jensljungblad / elemental_components

Simple view components for Rails 5.1+
MIT License
76 stars 5 forks source link

Simplify rendering and pass hashes to templates #20

Closed jensljungblad closed 5 years ago

jensljungblad commented 6 years ago

This PR changes rendering quite a bit, and also the API. The building of components API stays mostly the same, but the data passed to the partial is now a hash instead of the component object itself. This is one alternative to solve #19. Will attempt another where the component is still passed to the template.

Some pros with this solution:

(We could add a top level key as well if we want to, and then wouldn't have to use local_assigns for reserved words)

Todo

jensljungblad commented 5 years ago

Closing in favor of #21