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 %> |
| </section> |
| |
| <%= 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> |
| |
| <ul> |
| <% order.errors.full_messages.each do |message| %> |
| <li><%= message %></li> |
|
Get Agile Web Development with Rails 5.1 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.