Mike_C
(Mike C)
December 20, 2010, 1:03am
1
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.
daze
(daze)
December 21, 2010, 2:44am
2
I'm wondering about something along these lines too.......
11155
(-- --)
December 21, 2010, 5:13am
3
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,
daze
(daze)
December 21, 2010, 6:58am
4
Curtis1
(Curtis)
December 21, 2010, 6:36pm
5
what is your output of :
% rake routes | grep stories
Mike_C
(Mike C)
December 21, 2010, 6:40pm
6
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.