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:
----------------------
<h1>New Blog Entry</h1>
<%= error_messages_for :entry %>
<% form_for(:entry, :url => user_entries_path) do |f| %>
<p>Title:<br /><%= f.text_field :title, :size => 40
-%></p>
<p>Blog Entry:<br /><%= f.text_area :body, :rows => 10, :cols
=> 60 -
%></p>
<p><%= f.submit "Create" %></p>
<% end %>
<%= link_to ''Back'', user_entries_path(@user) %>
please heeeelp!!!
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---