Skip to content

Instantly share code, notes, and snippets.

@shankardevy

shankardevy/show.html.eex Secret

Last active Sep 18, 2017
Embed
What would you like to do?
<h1 class="page-title"><%= title_case @name %></h1>
<div>
<%= for product <- @products do %>
<div class="product">
<div class="product-name"><%= product.name %></div>
<div>₹ <span class="product-price"><%= product.price %></span></div>
</div>
<% end %>
</div>
@ocwang

This comment has been minimized.

Copy link

@ocwang ocwang commented Jul 20, 2017

This class is missing the css classes for each element. Following our previous code examples, this file should look like

<h1 class="page-title"><%= title_case @name %></h1>
<div>
  <%= for product <- @products do %>
      <div class="product">
          <div class="product-name"><%= product.name %></div>
          <div>₹ <span class="product-price"><%= product.price %></span></div>
      </div>
  <% end %>
</div>

Also, at this point, we haven't added a picture property to our Product struct. So if you add lines 6-8, the category_page_test.exs test will fail with the following error:

image

@BryanJBryce

This comment has been minimized.

Copy link

@BryanJBryce BryanJBryce commented Sep 18, 2017

Where does the title_case function come from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment