and couldn’t select Espanol.
I’ve had issues with the language box in Safari 5, I can’t select Espanol. the code for that is in: store.html.erg
Anyone knows the answer?
<%= select_tag 'locale', options_for_select(LANGUAGES, I18n.locale), :onchange => 'this.form.submit()' %>
On mine (Rails 2.3.8) I had to add .to_s to I18n.locale as it returns a symbol, not a string.
<%= select_tag 'locale', options_for_select(LANGUAGES, I18n.locale.to_s), :onchange => 'this.form.submit()' %>
.h4 Pierre says
This refers to Playtime Task 2, Activity 2
I have added a helper to application_helper.rb
def currency_to_locale(price) price = price * 1.3 if 'es' == params[:locale] number_to_currency price end
Then in app/views/store/index.html.erb I utilize the helper
... currency_to_locale(cart.total_price) %> ...
And also in app/views/store/_line_item.html.erb
... <td class="item_price"><%= currency_to_locale(line_item.total_price) %></td> ...
And finally in app/views/carts/_cart.html.erb
... <td class="total_cell"><%= currency_to_locale(cart.total_price) %></td> ...
This works fine in the browser. But the functional and integration test fails each with the same error
test_shipping_the_product(UserStoriesTest): ActionView::Template::Error: undefined method `currency_to_locale' for #<#<Class :0x00000004882c88>:0x00000004990b70> ~/work/depot/app/views/line_items/_line_item.html.erb:9:in `_app_ views_line_items__line_item_html_erb___4544981081009683343_38610780'
I would be happy if anybody could give me a hint to resolve this issue.