Hello,
I''ve been developing an app with Rails/Apache/FastCGI on OS X and 
recently tried to test it out with lighttpd.  I got it running with 
this config:
server.port = 8080
server.bind = "127.0.0.1"
server.event-handler = "freebsd-kqueue" # needed on OS X
server.modules = ( "mod_rewrite", "mod_fastcgi" )
url.rewrite = ( "^/$" => "index.html",
"^([^.]+)$" => "$1.html" )
server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "/home/zach/rails/public"
server.errorlog      = "/home/zach/log/lighttpd.error.log"
fastcgi.server = ( ".fcgi" =>
   ( "localhost" =>
       (
         "min-procs" => 1,
         "max-procs" => 5,
         "socket"   => "/tmp/application.fcgi.socket",
         "bin-path" =>
"/home/zach/rails/public/dispatch.fcgi",
         "bin-environment" => ( "RAILS_ENV" =>
"development" )
       )
   )
)
I''m having some problems with query parameters getting passed to my 
action, though...
When I try "http://localhost:8080/test?name[key]=val", and set a 
breakpoint in the test action, I get these results:
irb(#<TestController:0x2574650>):001:0> @params
=> {"name[key]"=>"val",
"action"=>"index",
"controller"=>"test"}
I have a lot of actions that rely on being able to access 
@params[''name''][''key''], but it seems like
they can''t do it with the new
setup.  Here''s the same action through Apache:
irb(#<TestController:0x2407614>):001:0> @params
=> {"name"=>{"key"=>"val"},
"name[key]"=>"val",
"action"=>"index",
"controller"=>"test"}
Does anyone know what''s going on here, and how I can fix my problem?
Thanks,
Zach
On 5/17/05, Zach Thompson <zach-DZILUfagCPWukZHgTAicrQ@public.gmane.org> wrote:> Hello, > > I''ve been developing an app with Rails/Apache/FastCGI on OS X and > recently tried to test it out with lighttpd. I got it running with > this config: > > When I try "http://localhost:8080/test?name[key]=val", and set a > breakpoint in the test action, I get these results:You''ve hit a known bug http://dev.rubyonrails.org/ticket/849 It will be fixed before the 1.0 release is made, however I can''t give any more detail than that. This does only affect GET actions though, have you considered switching to POST?> I have a lot of actions that rely on being able to access > @params[''name''][''key''], but it seems like they can''t do it with the new > setup. Here''s the same action through Apache: > > irb(#<TestController:0x2407614>):001:0> @params > => {"name"=>{"key"=>"val"}, "name[key]"=>"val", "action"=>"index", > "controller"=>"test"} > > Does anyone know what''s going on here, and how I can fix my problem? > > Thanks, > Zach > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz
On May 16, 2005, at 2:31 PM, Michael Koziarski wrote:> On 5/17/05, Zach Thompson <zach-DZILUfagCPWukZHgTAicrQ@public.gmane.org> wrote: >> Hello, >> >> I''ve been developing an app with Rails/Apache/FastCGI on OS X and >> recently tried to test it out with lighttpd. I got it running with >> this config: >> >> When I try "http://localhost:8080/test?name[key]=val", and set a >> breakpoint in the test action, I get these results: > > You''ve hit a known bug > > http://dev.rubyonrails.org/ticket/849 > > It will be fixed before the 1.0 release is made, however I can''t give > any more detail than that. > > This does only affect GET actions though, have you considered > switching to POST? >Thanks for pointing that ticket out.. It will be easy to switch to POST, so I''ll probably do that. I think another solution would be to flatten out my variable names, so "search[params][first_name]" would become "search_params_first_name". One reason I was using GET was so people could bookmark search results pages with the search query in the URL. Thanks, Zach