No action responded to create

Hey guys!Ihave a problem with a nested resource: when i subbmit the
new page i receive:No action responded to create
the controller :

def create
@entry = @user.entries.new(params[:entry])
respond_to do |format|
if @entry.save
flash[:notice] = ‘Entry was successfully created.’
format.html { redirect_to([@user, @entry]) }
format.xml { render :xml => @registration,
:status => :created,
:location => [ @user, @entry ] }
else
format.html { render :action => “new” }
format.xml { render :xml => @entry.errors,
:status => :unprocessable_entity }
end
end
end
routes.rb:

map.resources :users, :member => { :enable => :put } do |users|
users.resources :roles
users.resources :entries do |entry|
entry.resources :comments
end

end
new entry view:

New Blog Entry

<%= error_messages_for :entry %>

<% form_for(:entry, :url => user_entries_path) do |f| %>

Title:
<%= f.text_field :title, :size => 40 -%>

Blog Entry:
<%= f.text_area :body, :rows => 10, :cols => 60 - %>

<%= f.submit "Create" %>

<% end %>

<%= link_to ‘Back’, user_entries_path(@user) %>

please heeeelp!!!

cristina wrote:

Hey guys!Ihave a problem with a nested resource: when i subbmit the
new page i receive:No action responded to create
the controller :

[…]


New Blog Entry

<%= error_messages_for :entry %>

<% form_for(:entry, :url => user_entries_path) do |f| %>

Title:
<%= f.text_field :title, :size => 40 -%>

Blog Entry:
<%= f.text_area :body, :rows => 10, :cols => 60 - %>

<%= f.submit "Create" %>

<% end %>

<%= link_to ‘Back’, user_entries_path(@user) %>

I think you should add the user to your form url which means it should
be “:url => user_entries_path(@user)” where @user is the variable set
once logged in or so.

Guillaume Petit
www.nomadsper.com