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:
Do not need a top level key
Can use reserved words such as yield and class
(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
[x] Serialize components to hashes
[x] Add pluralization support
[x] Render correct template based on component name
[x] Rename content to yield
[x] Create separate PR where component is still passed to template, for comparison
[ ] General clean up if we move forward with this one
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:
yield
andclass
(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
content
toyield