开发者

apache2 + Passenger3 + Rails3 routing problem

开发者 https://www.devze.com 2023-03-14 04:34 出处:网络
Having a problem with passenger 3 in routes.rb i have match\'main/subgroups/:id\' =>\'main#subgroups\'

Having a problem with passenger 3

in routes.rb i have

match 'main/subgroups/:id' => 'main#subgroups'

And in access_log file

"GET /main/subgroups/Arts HTTP/1.1" 304 - "-" "GET /main/subgroups/Arts%2FCrafts%2FNeedlework HTTP/1.1" 404 323 "-"

As I understand Apache does not pass the second request to passenger.

What 开发者_StackOverflow中文版should I change in httpd.conf?


The problem is that the second URL is not matching the route since your 'id' field has forward slashes in it, which is a delimiter for rails routes.

In order to make this work try changing your route to (Note the * instead of the : on id):

match 'main/subgroups/*id' => 'main#subgroups'

That should ensure that everything after main/subgroups is set into params[:id] regardless of it's contents.

0

精彩评论

暂无评论...
验证码 换一张
取 消