Skip to content

Instantly share code, notes, and snippets.

@shankardevy
Last active September 18, 2017 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shankardevy/e3f9dc3c0a3d3cde517439c5a73aff4d to your computer and use it in GitHub Desktop.
Save shankardevy/e3f9dc3c0a3d3cde517439c5a73aff4d to your computer and use it in GitHub Desktop.
<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
Copy link

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
Copy link

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