Guruza search results for rubyonrails http://guruza.com/searches/show/326 Questions recently submitted to Guruza that match the query: rubyonrails Thu, 21 Aug 2008 11:28:50 -0700 $5.00 - My site spans ajax requests that take a while to execute on the server. Howe... http://guruza.com/question/360/reward-5.00 My site spans ajax requests that take a while to execute on the server. However, this request becomes invalid if the user makes another request before the first one is completed. In order to save server resources, I'd like to be able to kill the 1st server request when the second one is sent. I was thinking about polling the session to see if a certain criteria is met. If it is, I'd just abort the current call. How would I do that? I guess I'd have to launch a second thread when the ajax request starts (on the server side) and that thread would poll the session every 100ms or so. If the criteria is met, it would kill the request. I'd like to see a code example of this. Wed, 30 Aug 2006 00:25:10 -0700 $20.00 - *Rails Output Streaming* I am revisiting this again because I am in a situat... http://guruza.com/question/358/reward-20.00 *Rails Output Streaming* I am revisiting this again because I am in a situation where I need output streaming. Rails has two methods that utilize streaming (send_data, send_file) I've modified this to meet my needs, along with the help of people on the mailinglist. However the code below which should work, does not provide output streaming. I know in the past output streaming has worked within rails, I am wondering if in a current release it has been broken. Whatever the case is, I need to determine why I cannot get the output streaming mechanism in rails to work. I'm using lighttpd on fc5. I've used mongrel with the same results. class TestController < ApplicationController def index render :text => Proc.new { |resp, out| out.puts 'start' out.flush 10.times do out.puts '.' out.flush sleep 1 end out.puts 'done' } end end Tue, 29 Aug 2006 14:02:10 -0700 $5.00 - Validating Multiple Models The problem is that when I use error_messages_f... http://guruza.com/question/321/reward-5.00 Validating Multiple Models The problem is that when I use error_messages_for to display validation errors for two models, only the parent model's validation is displayed and not for the relationships. Example. class Resource < ActiveRecord::Base has_one :setting end class Setting < ActiveRecord::Base belongs_to :resource end If I do: @resource = Resource.new @resource.settings = Settings.new @resource.save! Only Resource's validation shows up and not Setting's. Is there anyway that I can validate the relationships of a model? *ANSWER* "if model1.valid? and model2.valid? and model3.valid? save model data" Wed, 16 Aug 2006 11:14:30 -0700 $5.00 - When i start WEBrick, it simply says "=> Booting WEBrick..." then returns... http://guruza.com/question/289/reward-5.00 When i start WEBrick, it simply says "=> Booting WEBrick..." then returns to command line. Any idea why? I am using OS X and Ruby 1.8.4. I tried reinstalling Ruby, didn't help. Here's what I get when I run script/console: LLoading development environment. /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- lib/partial_classes/string.rb (MissingSourceFile) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require' from ./script/../config/../config/environment.rb:51 from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules' from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules' from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup' from /usr/local/lib/ruby/1.8/irb.rb:54:in `start' from /usr/local/bin/irb:13 Mon, 31 Jul 2006 09:34:08 -0700 $0.00 - what is rubyonrails? http://guruza.com/question/287/reward-0.00 what is rubyonrails? Sun, 30 Jul 2006 01:55:29 -0700