Iteration K3: Translating Checkout

Now we’re entering the home stretch. The new order page is next:

 <section class=​"depot_form"​>
» <h1>​<%=​ t(​'.legend'​) ​%>​</h1>
 <%=​ render ​'form'​, ​order: ​@order ​%>
 <%=​ javascript_pack_tag(​"pay_type"​) ​%>

Here’s the form that’s used by this page:

 <%=​ form_with(​model: ​order, ​local: ​​true​) ​do​ |form| ​%>
 <%​ ​if​ order.​errors​.​any?​ ​%>
  <div id=​"error_explanation"​>
  <h2>​<%=​ pluralize(order.​errors​.​count​, ​"error"​) ​%>
  prohibited this order from being saved:</h2>
 <%​ order.​errors​.​full_messages​.​each​ ​do​ |message| ​%>
  <li>​<%=​ message ...

Get Agile Web Development with Rails 6 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.