# "undefined method 'trips\_path for..." can anyone help?

**URL:** <https://www.ruby-forum.com/t/undefined-method-trips-path-for-can-anyone-help/131708>\
**Category:** Rails\
**Created:** [March 12, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/undefined-method-trips-path-for-can-anyone-help/131708 "2008-03-12T17:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fizban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f4b2a3/32.png) [@fizban](https://www.ruby-forum.com/u/fizban)\
**Post date:** [March 12, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/undefined-method-trips-path-for-can-anyone-help/131708/1 "2008-03-12T17:28:45Z")

</div>

Hi,

I’m trying to use recipe 20 (handle multiple models in one form from  
“advanced rails recipes” but I’m hitting the error in the topic…

I basically try to access /trips/new (it’s supposed to be an e-  
commerce solution for a tour operator) but new.html.erb raises:

### ERROR

NoMethodError in Trips#new

Showing trips/new.html.erb where line #2 raised:

undefined method `trips\_path’ for #ActionView::Base:0x178f504  
Extracted source (around line #2):

1: \<%= error\_messages\_for :trip %\>  
2: \<% form\_for(@trip) do |f| %\>  
3:

name \<%= f.text\_field :name %\>

  
4: 
  
5: \<% render :partial =\> ‘departure’, :collection =\>  
@trip.departures %\>
### END OF ERROR

What could cause the “trips\_path” undefined method? I’m guessing I  
forgot something in the controller? I have tried form\_for @trip as the  
book was suggesting but the error is still there, so I’m guessing  
that’s not the problem

So far I’ve been able to find solutions to my errors simply by  
googling for the error, but it’s not helpfull enough this time :\

Do you need me to paste some of the controllers or templates?

---

<div class="post-metadata">

**Author:** ![fizban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f4b2a3/32.png) [@fizban](https://www.ruby-forum.com/u/fizban)\
**Post date:** [March 12, 2008, 8:00pm UTC](https://www.ruby-forum.com/t/undefined-method-trips-path-for-can-anyone-help/131708/2 "2008-03-12T20:00:13Z")

</div>

Nevermind, solved.
