I'm not being able to redirect the user to the page I want after he creates a new "service" resource.
Here's the routes.rb:
resources :wsps do
resources :services
end
The html form:
<%= form_for([@wsp,@service]) do |f| %>
Services_controller.rb:
def new
@wsp = current_wsp
@service = @wsp.services.build
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @service }
end
end
def create
@wsp = current_wsp
@service = @wsp.services.build(params[:service])
if @service.save
redirect_to wsp_service_path
end
end
The wsp_service_path goes to /wsps/1/services and the error:
No route matches {:action=>"destroy", :controller=>"services"}
What am I doing wrong? Why cant't I use "wsp_service_path"?
Thank you.