I’m a little confused about custom routes in rails 3. I have a
variable that I had a default value for in rails 2, and changing it to
rails 3 version gives this:
match ‘stories/list/:story_list/:search’ => ‘stories#index’, :as =>
‘story_list’, :story_list => ‘popular’, :search => nil
When I use the route, I just call story_list_path(:story_list =>
‘search’, :search => ‘something’)
this worked in rails 2, but I’m getting this error in rails 3:
No route matches {:story_list=>“search”, :controller=>“stories”}
I can’t find out how to fix this as tutorials on the web just go over
basic changes and what not.
mikec
December 21, 2010, 3:46am
2
I’m wondering about something along these lines too…
mikec
December 21, 2010, 8:00am
3
On Dec 20, 9:13pm, Marnen Laibow-Koser [email protected] wrote:
Well, you didn’t quote the lines you were replying to, and you didn’t
state what you were wondering…so I’m left wondering how to read your
mind.
In future, please just ask what you need to ask.
Best,
Marnen Laibow-Koserhttp://www.marnen.org
[email protected]
Fine…
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/4fcc3b20b24822e5
wondering about how to use match with a route in an admin namespace…
mikec
December 21, 2010, 6:13am
4
daze wrote in post #969695:
I’m wondering about something along these lines too…
Well, you didn’t quote the lines you were replying to, and you didn’t
state what you were wondering…so I’m left wondering how to read your
mind.
In future, please just ask what you need to ask.
Best,
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
mikec
December 21, 2010, 7:41pm
5
After a few days of experimenting I think I got it fixed. All I did
was make the search variable optional, and removing it also does the
trick.
mikec
December 21, 2010, 7:38pm
6
On Sun, Dec 19, 2010 at 5:03 PM, Mike C [email protected] wrote:
this worked in rails 2, but I’m getting this error in rails 3:
No route matches {:story_list=>“search”, :controller=>“stories”}
I can’t find out how to fix this as tutorials on the web just go over
basic changes and what not.
what is your output of :
% rake routes | grep stories
–
make haste slowly
festina lente \
mobile +1_415_632_6001
[email protected]
http://robotarmyma.de