Prev | Current Page 394 | Next

Brad Ediger

"Advanced Rails"

text_field :mobile_phone %>




<%= @person_form.text_area :address, :size => '30x5' %>




<%= @person_form.text_field :country %>


app/views/people/show.html.erb

<%=h @person.full_name %>


Phone Numbers



<% unless @person.home_phone.blank? %>
Home

<%=h @person.home_phone %>

<% end %>
<% unless @person.office_phone.blank? %>
Office

<%=h @person.office_phone %>

<% end %>
<% unless @person.mobile_phone.blank? %>
Mobile

<%=h @person.mobile_phone %>

<% end %>

Address


<%= simple_format(h(@person.address_with_country)) %>

<%= link_to "Address Book", people_path %>


262 | Chapter 8: i18n and L10n
Complete the first iteration with a very simple XHTML layout and stylesheet:
app/views/layouts/people.html.erb
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Address Book
<%= stylesheet_link_tag 'default' %>


<%= yield %>


public/stylesheets/default.css
body {
font-family: sans-serif;
}
form label {
display: block;
float: left;
width: 130px;
text-align: right;
padding: 3px 5px;
}
Although this application leaves out many features that you would want in a real
address book, it will serve our purposes to demonstrate localization with Globalize.


Pages:
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406