search for: hylesanderson

Displaying 20 results from an estimated 24 matches for "hylesanderson".

2006 Feb 16
5
Firefox and IE performance with Rails App
...ks fine. The slow pages were typically posting a form with a couple hundred fields. This behavior was the same with the rails server running on Windows, Ruby 1.8.2, Apache2, FastCGI and also on Linux, Ruby 1.8.4, Lighttpd, FastCGI. Any ideas what would cause this? -- Jack Christensen jackc@hylesanderson.com
2006 Aug 10
4
Speeding up ActiveRecord creation?
My completely empty model (no validation callbacks etc etc) takes an average of 0.05 seconds to create, at least according to Benchmark.realtime{200.times{Message.create(:from => "me@here.com", :message_type => ''email'', :subject => "hello", :body => "goodbye", :sent_at => Time.now)}}/200 That''s a little slower than
2006 Feb 21
8
pdf generators
Hi Folks, Could you please comment on various PDF generators that one may use. Thanks. Lalit Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060221/8b319788/attachment.html
2006 Jul 17
1
How to DRY up validates_presence_of
...thout this check an exception will be thrown on access to the nil attribute return if start_date.nil? || end_date.nil? if end_date < start_date errors.add_to_base ''End date cannot be earlier than start date.'' end end Thanks. -- Jack Christensen jackc@hylesanderson.edu
2006 Apr 29
1
Warnings printed to console causes error if console closed on Linux
...to print the warning to the console. If I kept the terminal open that I started the server on it would print the warning, but not crash. I''m using lighttpd and scgi. I start the server by using scgi_cluster via SSH. Any ideas why this is happening? Thanks! -- Jack Christensen jackc@hylesanderson.edu
2006 Apr 20
1
has_many.count not accepting options hash
.../lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor d/associations/has_many_association.rb:47:in `count'' from (irb):21 It appears to call to_s on whatever is passed to it. Is this a bug, normal behavior, or am I doing something wrong? Thanks. -- Jack Christensen jackc@hylesanderson.edu
2006 Feb 03
6
Go back to previous action
Hello all! I have two views (list_1 and list_2) that show a list of users in two different ways. In the views for these actions there is a link to edit a specific user properties (edit_user). That works fine, except that when I change the user I want to go back to the view that originated the request and not to the default list (list_1). Can anyone help me? Best regards, Hugo -- Posted via
2006 May 23
8
ad-hoc query
How do you run an ad-hoc query that does not belong in any model? I thought it was something like ActiveRecord::connection.find("my query..."), but I can''t seem to find the documentation on it. I know I''ve seen it somewhere before, though. thanks, Jeff -- Posted via http://www.ruby-forum.com/.
2006 Aug 10
1
Customizing log output
I''d like to include the user name along with/instead of the session id in my log files. Is there a place to customize the log format, or do I just need to through the logger object and manually write it in a before_filter on my ApplicationController? Thanks. -- Jack Christensen jackc@hylesanderson.edu
2006 Jul 28
1
Nasty pitfall: don''t use ^ and $ in validation regexes!
Let''s say you want to validate that an attribute contains only 2-10 lowercase characters, e.g. with validates_format_of. The appropriate regex is obviously /^[a-z]{2,10}$/, right? Wrong! Try it with "abc\nANYTHING YOU LIKE" - this is perfectly valid. On the second look the reason is clear: ^ matches the start of a line, $ matches the end of a line. So as long as one line in
2006 May 09
2
Bulk Inserts. Fast way to insert 1000s records?
Hi, This code loops through my results and saves them : @results.each{|r| r.save} There are potentially thousands of results. This takes ages to complete. Is there a quicker way to do this? Any help is greately appreciated Thanks Chris -- Posted via http://www.ruby-forum.com/.
2006 Mar 10
0
Data modeling - representing data across models
...ours_scheduled_by_department_and_week( department, week ) seems rather messy. The last doesn''t seem to fit in any existing model. I guess the question boils down to where do you represent data that is the intersection or composite of multiple models? Thanks. -- Jack Christensen jackc@hylesanderson.edu
2006 Apr 20
3
has_many :through with has_many/has_many join models
...where clause is invalid. It is using: semesters.semester_id = #{student_semester_record.id} It should be using: semesters.id = #{student_semester_record.semester_id} Am I doing something wrong, is this a bug, or is this association type simply not supported? Thanks! -- Jack Christensen jackc@hylesanderson.edu
2006 Jun 05
5
Controller-wide instance variable
Is it possible to declare an instance variable in a controller that is available to every action without defining the variable in every action? -- Posted via http://www.ruby-forum.com/.
2006 Jul 06
6
Class variables in templates/layouts
I''m having problems with class variables.. I have a class: class Content::ApplicantsController < ApplicationController layout "mylayout" @@tab = "mystring" [... the rest is standard scaffold-created stuff ...] and a layout (mylayout.rhtml): [...] <title><%= @@tab.capitalize %></title> [...] And I keep getting this error: uninitialized
2006 Aug 01
2
HOWTO? security based on data values
Hi! I recently started with RoR and this may be a newbie question. I have a company table, employee table and transactions table. 1 company has many employees. Each employee performs many transactions. Employees from different companies LOGIN to the system to record their transactions. Employees can search on all transactions associated to their companies (indirect relationship via employee),
2006 Jul 28
3
Forms: handle foreign keys (AssociationTypeMismatch)
Hi all I tried and tried and tried, but I still fail in creating a form with proper validation and stuff for foreign keys... So I''d really like to get some help here. I''m creating a booking site for DJ''s, and for every booking one can choose one of different countries: class Booking < ActiveRecord::Base validates_presence_of :country_id
2006 Feb 23
9
Suddenly a Blank Page
This is apache/fcgi/rails/firefox. When using a rails app we have been experiencing sudden blank pages in the browser. We show an model "new object" page and start changing stuff and all of a sudden the page will be erased to blank! Any idea what could cause something like this? -- Posted with http://DevLists.com. Sign up and save your time!
2007 Jun 05
4
uninitialized constant RailsHandler::Dispatcher
Hello, I am running in to an error trying to run mongrel. The server starts but then trying to access any url in my application throws this error: calling Dispatcher.dispatch uninitialized constant RailsHandler::Dispatcher ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:477:in `const_missing''
2006 Jul 25
12
DRYing - similar named fields, etc.
I''m sorry - just couldn''t come up with a subject that describes the problem :( Anyway, this is my problem. I have a long list of fields that need to be displayed when a ''show'' is requested on the controller. I''m now doing the list.rhtml and looking for a DRY way to do the following. For each data item, I have 2 fields - one is the item name, the