On Tuesday, July 17, 2012 3:46:55 PM UTC-4, yatta20 wrote:
Here’s the information from the log file.
app/helpers/checkout_helper.rb:9:in `map’
<% content_for :head do %>
<%= render ‘summary’, :order => @order %>
Any ideas?
Checkout help
module CheckoutHelper
def checkout_progress
if Gateway.current and Gateway.current.payment_profiles_supported?
states = %w(address delivery payment confirm complete)
else
states = %w(address delivery payment complete)
end
items = states.map do |state|
text = t(“order_state.#{state}”).titleize
css_classes = []
current_index = states.index(@order.state)
state_index = states.index(state)
if state_index < current_index
css_classes << ‘completed’
text = link_to text, checkout_state_path(state)
end
css_classes << ‘next’ if state_index == current_index + 1
css_classes << ‘current’ if state == @order.state
css_classes << ‘first’ if state_index == 0
css_classes << ‘last’ if state_index == states.length - 1
# It’d be nice to have separate classes but combining them with a
dash helps out for IE6 which only sees the last class
content_tag(‘li’, content_tag(‘span’, text), :class =>
css_classes.join(’-’))
end
content_tag(‘ol’, raw(items.join("\n")), :class => ‘progress-steps’,
:id => “checkout-step-#{@order.state}”)
end
def address_field(form, method, id_prefix = “b”, &handler)
content_tag :p, :id => [id_prefix, method].join, :class => “field”
do
if handler
handler.call
else
is_required = Address.required_fields.include?(method)
separator = is_required ? ‘
’ :
‘
’
form.label(method) + separator.html_safe +
form.text_field(method, :class => is_required ? ‘required’ :
nil)
end
end
end
def address_state(form, country)
country ||= Country.find(Spree::Config[:default_country_id])
have_states = !country.states.empty?
state_elements = [
form.collection_select(:state_id, country.states.order(:name),
:id, :name,
{:include_blank => true},
{:class => have_states ? “required” :
“hidden”,
:disabled => !have_states}) +
form.text_field(:state_name,
:class => !have_states ? “required” : “hidden”,
:disabled => have_states)
].join.gsub(’"’, “’”).gsub("\n", “”)
form.label(:state, t(:state)) + '’.html_safe +
content_tag(:noscript, form.text_field(:state_name, :class =>
‘required’)) +
javascript_tag(“document.write(”#{state_elements.html_safe}");")
end
end