Last active
August 29, 2015 14:24
-
-
Save seaneshbaugh/03b680dfcdc6dd244e6c to your computer and use it in GitHub Desktop.
elixir haml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is what I ultimately want to reproduce: | |
| <%= form_for @changeset, @action, fn f -> %> | |
| <div class="form-group"> | |
| <label for="page[title]">Title</label> | |
| <%= text_input f, :title, class: "form-control" %> | |
| </div> | |
| <div class="form-group"> | |
| <label for="page[body"]>Body</label> | |
| <%= textarea f, :body, class: "form-control" %> | |
| </div> | |
| <div class="form-group"> | |
| <%= submit "Submit", class: "btn btn-primary" %> | |
| </div> | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This "works" in that it produces what I want. But it's an abomination. | |
| - form_for(@changeset, @action, fn f -> | |
| [safe("<div class=\"form-group\">"), | |
| safe("<label for=\"page[title]\">Title:</label>"), | |
| text_input(f, :title, class: "form-control"), | |
| safe("</div>"), | |
| safe("<div class=\"form-group\">"), | |
| safe("<label for=\"page[body]\">Body:</label>"), | |
| textarea(f, :body, class: "form-control"), | |
| safe("</div>"), | |
| safe("<div class=\"form-group\">"), | |
| submit("Submit", class: "btn btn-primary"), | |
| safe("</div>")] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment