similar to: active record adding odd chars to insert statement

Displaying 20 results from an estimated 1200 matches similar to: "active record adding odd chars to insert statement"

2006 Feb 03
3
My associations are coming out nil.
I''ve got a fairly simple system with a table for my Users that includes a CountryId field which looks up to the CountryId field of my Country table. What I would like to happen is for my Rails application, which contains models for both User and Country, to be able to draw the dropdown list of available countries on the edit page, like it does in all the tutorials. My model classes look
2006 Jan 30
4
dispatch.cgi Problem
Hey all, I''ve been battling with ruby configurations for days now...trying to get either SCGI or FCGI to work on my Apache 1.3/Linux Red Hat 3 server. I''ve pretty much gave up that battle since either of them will work with me after trying dozens of configurations, but now even when I try to run apps with dispatch.cgi I get this error in my log: "Premature end of
2006 Feb 21
3
HABTM :insert_sql help
Hi all, I''m working with a legacy sqlserver db and I''m trying to override the insert sql in as defined in the HABTM method below(becasue the join has three primary keys), but I''m getting the error: ''undefined local variable or method `record'' for Project:Class'' has_and_belongs_to_many :people, :class => ''Person'',
2005 Dec 30
2
rails running very slowly on apache (with fcgi or without)
Was wondering if there is anything obvious I may have missed in my setup that would cause it to run so slowly. WEBrick runs blazingly fast in comparison, in dev mode, so I''m sure there''s something off. Even in production mode requests take about 4 or 5 secs. Thanks! Win XP Apache 2 Rails 1.0 -rich
2006 Jan 15
7
Dreaded Internal 500 Error on DreamHost.
Hey guys, I often get this problem the first time I try to deploy a rails app on dreamhost and I''m not sure what the cause is. Basically, I have an app that''s running fine on my local machine. I''ve uploaded the app, configured and migrated to the latest version of the db, and set all of the necessary directories to 755. But when I run dispatch.rb in ssh or
2006 Jan 25
38
Rails app won''t run on Dreamhost - "incomplet headers" error
Can anyone provide some expert debugging help here? What''s the first step to take to see what the issue is here? I have no errors in the rails app''s log files. The only errors I have are those provided by apache and they are: ''FastCGI: Incomplete headers (0) bytes received from server'' I''ve tried editing the shebang line, removing line feeds, but
2006 May 19
1
LoadError - no such file to load -- pathname (Dreamhost)
I''ve started getting the following error on Dreamhost when trying to run any scripts or dispatch.* [barry]$ ruby -d script/server Exception `LoadError'' at ./script/../config/boot.rb:6 - no such file to load -- pathname ./script/../config/boot.rb:6:in `require'': no such file to load -- pathname (LoadError) from ./script/../config/boot.rb:6 from
2006 Apr 17
2
Email Multipart message
Hi, I use the multipart functionality from the action mailer. But when i send an html message, my outlook opens the mail and shows this: --mimepart_4443b76d12268_6f34..fdacc616831e6 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline <!!Message> = = --mimepart_4443b76d12268_6f34..fdacc616831e6-- No html will appear. When
2006 Feb 25
2
ActionFaxer?
Hi, I would like to use ActionMailer to send and email but I also want to send a copy of the email as a Fax. Is this possible? Thanks, Peter
2006 Apr 21
1
Data access problem in object when using acts_as_authenticated
Hi all, I''m running into this frustrating issue with the acts_as_authenticated plugin and one of the additional fields I added to the users table. I have added a column ''account_type'' to the users table (among several others) which denotes the type of account it is. This stores an integer value that is set by the system during account creation. The value is getting set
2005 Dec 22
3
help with unless
Hi, I need a fresh set of eyes to look at this bit of controller code and tell me why I might be getting an error message: lookup = Profit.find(:all, :conditions => [ "user_id = ? AND product_id = ?", uid, pid]) unless lookup.empty? if (lookup.updated_on > 360.minutes.ago) return end end If lookup is empty, then I
2006 Aug 04
1
Need a better undersanding of form helpers
perhaps someone can take a little time to give me a better understanding of how to use form helpers. Here is what I''m working with in my app: user model - (the table where a user registers their information) it contains the following fields - first_name last_name email account_type (currently set to string but will probably be a select box with options) password_salt (I''m
2006 May 19
0
No luck with multiple before_filters
I''ve got these two lines set up in my controller before_filter :check_authentication before_filter :check_max_hands, :only => [ :play ] Here''s the corresponding code for each def check_authentication unless session[:user] and authorize?(session[:user]) session[:intended_action] = request.request_uri redirect_to :controller => ''user'',
2006 Feb 24
1
RailsCron: Trigger one time
Hi Kyle, Thanks for your help so far. Now that I have it up and running, I''ve some behavior questions. I want to trigger an event just one time at a future time. I''m using some of your sample code to try this, but the behavior of some combinations of start, every, and finish behave in some unpredictable ways. 3 class RailsMaintainer 4 include ActsAsBackground
2007 Jan 26
0
Problems with assert_select in integration tests
I''ve been battling with assert_select in my integration tests for several evenings now. I''m testing a multi-step form, and after submitting the first step, my assert_selects fail on the attempts to find the form on the next page. However if I print out the response object, it has the exact text of what I''m trying to match. Here is the complete integration test. The
2006 May 31
3
validate unless, LoginGenerator difficulty
I apologize if this is a very simple question; I''ve searched the forums, wiki, Google, and Agile Web Development with Rails to no avail. Is there a way to put conditional validation in the model? For instance, if I want to limit items a user can add unless the user is an admin? My current code is: validates_uniqueness_of :user_id, :scope => ''event_id'',
2006 Mar 31
4
Date magic?
Hi. When I read Dave and Davids excellent book "Agile Web Development with Rails" the first time, I was particularly impressed with the following statement: 1.day.from_now It was used in a test class to set the date of tomorrow dynamically. Since it was enclosed in in ERb tags, I assumed this was a normal ruby statement, but when I tried it in my irb, i get the following error:
2006 Feb 23
1
RailsCron: ''every'' in background
Got another question. It''s unclear to me what "every" means in the background function and how it relates to the RailsCron.create "every": >From README: RailsCron.create( :command => "Object.do_something()", :start => 2.minutes.from_now, :every => 12.hours, # default: 1.day :finish =>
2006 Dec 01
2
Mongrel 0.3.18, rails 1.1.6 and cookies
I''ve run into an issue with my rails application being unable to properly set cookies on Mongrel 0.3.18. If I run the simplified code below in Mongrel 3.14.4, both cookies are properly sent to and saved by the browser. With the same code in 0.3.18, only the auth_token cookie is created (if I switch them, only the userid as it will only properly create the first cookie in the list.)
2008 Oct 11
1
Re: time_ago_in_words is off by a day
Look at your 1.day.from_now and see if it''s like this: Sun, 12 Oct 2008 02:45:42 UTC +00:00 If you also have the "UTC +00:00", it means that you timezone is the GMT (and I think that it isn''t your real timezone). For example, my timezone is 3 hours after the GMT, so the right timezone would be something like this: Sat Oct 11 23:48:41 -0300 2008 At your