[Rails] Re: Ajax with JQuery

2010-06-02 Thread hoenth
Try using the noConflict setting //define function to be executed on document ready var $j = jQuery.noConflict(); $j(function(){ $j("#user_name").validate({ expression: "if (VAL) return true; else return false;", message: "Please enter the Password" }); }); On Jun 2, 8:0

[Rails] Re: DRY (don't repeat yourself) way / Hook to Activerecord o

2009-06-11 Thread hoenth
> God please tell me he did not suggest to use threads in order to add an > argument. > -- > Posted viahttp://www.ruby-forum.com/. Here is a brief discussion on Thread.current used in class variables. http://coderrr.wordpress.com/2008/04/10/lets-stop-polluting-the-threadcurrent-hash/ As there

[Rails] rails looking for partial with .erb extension instead of .html.erb

2009-06-10 Thread hoenth
I recently deployed a new version of my application. Unfortunately, I accidentally placed a folder containing two partials in the wrong repository (I had copied them from another application), so when I deployed, they were not included. Once I discovered this, I added this folder and the two parti

[Rails] Re: DRY (don't repeat yourself) way / Hook to Activerecord object (to store IP address on every object created)

2009-06-10 Thread hoenth
> > > > Makund - it is quite likely that your solution will break when > > > multithreading arrives (as will will loads of other stuff) > You could try using Thread.current in your model when storing your class variable. For example, in your User model, you could have the following methods: d

[Rails] Re: Needs some help with eager loading issue on a has_many through relationship

2008-12-04 Thread hoenth
Philip/Fred thank you for your thoughts. it never ceases to amaze me how some things manage to fix themselves. After looking into this for a couple of hours over the last two days, I reran the page today, and checking into the development log found that I am now down to 3 queries. The homeroom

[Rails] Re: Needs some help with eager loading issue on a has_many through relationship

2008-12-03 Thread hoenth
CTED]> wrote: > On Dec 3, 1:55 pm, hoenth <[EMAIL PROTECTED]> wrote:> Fred, > > > I appreciate your quick response. > > > I am confused though. I thought the point of includes was to get all > > of the related objects in as few db calls as possible. From the log &

[Rails] Re: Needs some help with eager loading issue on a has_many through relationship

2008-12-03 Thread hoenth
m running 2.1.2 Thanks for your help. Tom On Dec 3, 8:23 am, Frederick Cheung <[EMAIL PROTECTED]> wrote: > On Dec 2, 10:45 pm, hoenth <[EMAIL PROTECTED]> wrote: > > > Any idea why Rails seems to be ignoring the :include? > > It's not  - that's the way it does inc

[Rails] Needs some help with eager loading issue on a has_many through relationship

2008-12-02 Thread hoenth
I have the following: 1. A model called Student, which is an STI sub-class of Person 2. Student has the following associations has_many :homerooms has_many :classrooms, :through => :homerooms has_one :current_classroom, :through => :homerooms, :source => :classroom, :cond

[Rails] Re: stuck on a validates_presence_of unless issue

2008-11-02 Thread hoenth
I must have looked at those API docs 10 times and didn't see it. Would have bitten...and all that. Thanks for the quick response Craig. Worked like a charm. Tom On Nov 1, 9:05 am, "Craig Demyanovich" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 1, 2008 at 5:29 AM, hoenth &

[Rails] stuck on a validates_presence_of unless issue

2008-11-01 Thread hoenth
i have a person object. Persons don't need to have addresses, but if they have any address field value, they must have them all. So I have something like this: validates_presence_of :street_address, :city, :state, :postal_code unless :address_blank? address_blank? checks whether all of the addre