Hi folks, can you spare some time? i could sure use it.
This is the error message :
ArgumentError in Store#save_order
Showing app/views/store/checkout.html.erb where line #10 raised:
interning empty string
Extracted source (around line #10):
7:
All fields marked with * are required
8:
9: <% form_for :order, :url => { :action => :save_order } do |
form| %>
10: <%= form.error_messages %>
11:
12:
13:
!!i get this error when i try to submit an empty form or any data !!
this is the save_order, mentioned in the error message
def save_order
@order = Order.new(params[:order])
if @order.save
@cart = find_cart
@order.add_line_items_from_cart(@cart)
session[:cart] = nil
flash[:notice]="Order placed successfully! "
redirect_to :action => ‘show_order_details’
else
render :action => ‘checkout’
end
end
this is the code’s view :
<% form_for :order, :url => { :action => :save_order } do |form| %>
<%= form.error_messages %>
Total worth of your books is
<%=
currency_euro(@cart.total_price_of_products) %>
<%= form.label :name, "*Name " %>
<%= form.text_field :name, :size => 30 %>
<%= form.label :surmane, "*Surname " %>
<%= form.text_field :surname, :size => 30 %>
<%= form.label :adress, "*Adress " %>
<%= form.text_area :adress, :rows => 4, :cols => 35 %>
<%= form.label :telephone, "*Telephone " %>
<%= form.text_field :telephone, :size => 30 %>
<%= form.label :email, “*Email " %>
<%= form.text_field :email, :size => 30 %>
<%= form.label :pay_type,”*Pay type " %>
<%= form.select :pay_type,Order::PAYMENT_TYPES,:prompt
=> “Select a payment method” %>
<%= submit_tag “Place order”, :name => nil, :class =>
“submit” %>
<% end %>
Total worth of your books is
<%=
currency_euro(@cart.total_price_of_products) %>
<%= form.label :name, "*Name " %>
<%= form.text_field :name, :size => 30 %>
<%= form.label :surmane, "*Surname " %>
<%= form.text_field :surname, :size => 30 %>
<%= form.label :adress, "*Adress " %>
<%= form.text_area :adress, :rows => 4, :cols => 35 %>
<%= form.label :telephone, "*Telephone " %>
<%= form.text_field :telephone, :size => 30 %>
<%= form.label :email, “*Email " %>
<%= form.text_field :email, :size => 30 %>
<%= form.label :pay_type,”*Pay type " %>
<%= form.select :pay_type,Order::PAYMENT_TYPES,:prompt
=> “Select a payment method” %>
so my question is…what is the message saying, and how should i fix
this problem??
a billion thx in advance,
radu