Here’s how to use AJAX from the onchange event of the SELECT element :
I used an extra ERB step in my view in order to reduce chaos being created by double quotes. This example actually triggers two AJAX calls on the event to update different targets (two cascaded SELECTs).
I’m trying to configure a production-mode Win2003 server for rails apps.
I ran down the rabbit hole for all of the following configurations :
Cygwin/lighttpd SCGI/FastCGI: compiling errors on both my dev machine and vmware test.
InstantRails / SCGI : well, after figuring out how to run production-mode scgi_server as a windows service (details below), I still have trouble getting InstantRails to run as a “service” itself. This is not the fault of InstantRails, and Curt, you get KUDOS KUDOS KUDOS for the work in gettting InstantRails to work at all! (see below for some details on how to auotmate the scgi-as-a-service installation, when you get InstantRails running as a service itself (or at least the apache/mysql servers).
IIS / FastCGI : 404 error every time. With no log output, there’s nothign to see and nothing to do.. except look elsewhere for a solution!
As an MSDN subscriber (thanks to my corporate sponsors employers) and MCP (SQL Designer test or something, I’ve forgotten), this is very enticing…
AND .NET has failed me in several situations where I was trying to do something “outside the box”.
How does Ruby on Rails compare to this ?
Well the 10 minute video is almost a religious experience to many. AND Ruby and Rails DOES NOT fail us in situations where we wish to go “outside the box” in order to accomplish something.
I ran down the rabbit hole for all of the following configurations :
Cygwin/lighttpd SCGI/FastCGI: compiling errors on both my dev machine and vmware test.
InstantRails / SCGI : well, after figuring out how to run production-mode scgi_server as a windows service (details below), I still have trouble getting InstantRails to run as a “service” itself. This is not the fault of InstantRails, and Curt, you get KUDOS KUDOS KUDOS for the work in gettting InstantRails to work at all! (see below for some details on how to auotmate the scgi-as-a-service installation, when you get InstantRails running as a service itself (or at least the apache/mysql servers).
IIS / FastCGI : 404 error every time. With no log output, there’s nothign to see and nothing to do.. except look elsewhere for a solution!
Here’s the final solution :
Assuming your’e doing this on a virgin server : install ruby and rails and your rails app.. .test on webrick.
Install Apache 2 (follow the directions, etc.)… test it for basic functionality “You were expecting your site but you got this page instead”.
Get the mod_scgi binary and copy to /modules (that link is assuming Apache 2… Zed has Apache 1 on the site as well.
Configure /conf/httpd.conf according to the howto. This includes a LoadModule line and a configuration.
Get srvany.exe kit from vbRad. Expand it to a simple location like C:srvanykit.
Run C:srvanykitinstsrvw.exe. Follow the wizard. The PATH TO THE APPLICATION.EXE IS : C:srvanykitsrvany.exe. THIS IS REQUIRED. You will configure the actual path to scgi_server in a minute.
Run regedit. Find the key for your service at :
HKLM/System/CurrentControlSet/Services/
Add a new key : /Parameters
Add a new string value : Parameters/Application.
Value = (path-to-ruby) (path-to-scgi_server)
Ie “C:rubybinruby.exe C:rubybinscgi_server”
Add a new string value : Parameters/AppDirectory.
Value = (path-to-rails-app-root)
Ie “D:rails_appscookbook”
Open Service control panel (Start -> Control Panel -> Adminstrative Tools -> Services). Find your service. Start it… should be running!
Test the rails app: Go to http://localhost.
If you have a routes issue it needs to be addressed now.
I’ll edit this post with updates as they are necessary.