elixir-web / weber

[WiP] Web framework for Elixir inspired by Rails [#WeberMVC at freenode]
http://elixir-web.github.io/weber/
MIT License
371 stars 33 forks source link

Partials #164

Closed 0xAX closed 10 years ago

0xAX commented 10 years ago

Proposal

Add render partials helpers to the weber/lib/helper - partial.ex.

  1. Create Helper module, Weber.Helper.Partial
  2. Add Weber.Helper.Partial to the every view with: https://github.com/0xAX/weber/blob/master/lib/weber/utils/utils.ex

3.. Rendering just partial, without any options.

If we have /views/app/index.html with:

<%= render "menu" %>

render will find /views/app/_menu.html and put it's content instead render helper or empty "" if there is no partial with this name.

  1. Passing local variables to the partial:
<%= render "menu", [vars: @menus] %>

Any additional suggestions? cc: @matheusca, @cbd

0xAX commented 10 years ago

is anybody whants to grab?

cbd commented 10 years ago

I'm going to take a crack at this

0xAX commented 10 years ago

170