应用国际化与部署指南
1. 结账页面翻译
1.1 新订单页面
新订单页面的代码如下:
rails51/depot_t/app/views/orders/new.html.erb
<section class="depot_form">
<h1><%= t('.legend') %></h1>
<%= render 'form', order: @order %>
</section>
<%= javascript_pack_tag("pay_type") %>
该页面使用的表单代码如下:
rails51/depot_t/app/views/orders/_form.html.erb
<%= 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 |mess
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



