Patrick Doyle wrote:
> 2009/10/15 P�l Bergstr�m <[email protected]>:



I have this view/new

<% form_tag :action => 'create' do %>

  <%= error_messages_for 'customer' %>

  <label>Förnamn</label>
  <%= text_field :customer, :first_name %>


  <label>E-post</label>
  <%= text_field :customer, :email %>


  <br />
    <%= submit_tag 'Create' %>

<% end %>

And I have this in controller:

 def new
    @customer = Customer.new(params[:customer])
  end

  def create
    @customer = Customer.new
    if @customer.save
      flash[:notice] = "Nytt konto skapat"
      redirect_to :controller => 'basket'
    end

  end

And this in model

validates_presence_of :first_name, :email

I can't get it right. I now get "Missing template customer/create.erb in 
view path app/views" when trying to save without :first_name


-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to