Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Path helpers generate paths with dots instead of slashes

In my routes.rb I have the following:

resources :message_threads 

When I call:

message_threads_path(1) 

I get:

/message_threads.1 

Why is this? My other resources work fine. Am I not pluralizing this correctly or something?

like image 699
ghempton Avatar asked Apr 15 '11 08:04

ghempton


1 Answers

Yes, this is a pluralization error.

By passing the ID 1, I assume that you wish to display a single record.

So you need to use the singular 'message_thread':

message_thread_path(1) 

Which will yield:

http://localhost:3000/message_threads/1 
like image 60
Scott Avatar answered Oct 22 '22 06:10

Scott