similar to: sql query in active record

Displaying 20 results from an estimated 10000 matches similar to: "sql query in active record"

2006 Nov 04
4
live search
hi all, i have implemented live search using scriptulous and i am getting the list the problem is that when i select an item from the list white spaces gets appended in front " item" of the selection in firefox and in opera front and behind " item " i printed the value in console and saw it gives "item" but in textbox after selection whitespaces gets appended
2006 Jun 18
5
on change of drop down showing a new textfield
hi, i have a situation where i have a list of options from which a user selects his options if its not in the list he/she selects Others/Not Present and a new textfield should pop up and the data entered there should be considered instead of dropdown. i have done this using javascript/dhtml but i was wondering how this can be done using pure rails i.e using some of the RoR apis?. i would
2006 Jun 18
3
on change of drop down a textfield emerging
hi, i have a situation where i have a list of options from which a user selects his options if its not in the list he/she selects Others/Not Present and a new textfield should pop up and the data entered there should be considered instead of dropdown. i have done this using javascript/dhtml but i was wondering how this can be done using pure rails i.e using some of the RoR apis?. i would
2006 Jul 21
10
why validation on server side
hi, i have noticed that the validations in RoR happen at server side mostly what sites do is using javascript they validate user information there... whats the point of doing it at the server side is it that loading of javascript file in a browser makes a response to client slow and validation at server side offsets that....????? any sugeestions???? is it that i am missing something as
2006 Jul 21
20
Struts vs RoR
hi, I recently attended one of the ruby meetings that we have in my city. There one of the speaker said that google,amazon .. are working on RoR but still the performance of RoR is not at par with J2EE others.... he meant that though google,amazon working o it they will not bring it as front applications only parts the reason ruby is slow in comparison to other languages.... and in real time
2006 Jun 29
3
stylesheets
hi, all i have been playing around with rails for sometime, i have seen most not all of the rails sites have similar look and feel (good one) i want to know how to use the stylesheets provided by the RoR framework if any or is it that we have to define on our own from scratch. basiclly i need information regarding how can i make my view better looking(the visuals) Thanks in advance warm
2008 Jul 04
2
How to make WHERE foo_id IN () query?
Hi, There are 3 models: A has_many :Cs B has_many :Cs C belongs_to A and B I got a single object of A and an array of B objects. How can I get all Cs that have a_id equal to object A.id *and* b_id that belongs to an object in Bs array? Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Feb 28
4
multiple keys table
probablly a newbie question: Rails does not support a table with multiple keys ??? it seems that the ActiveRecord set_primary_key method can only set the column name... (hope i''m wrong there) example: table A - P.K id, string name table B - P.K id, string name table C - P.K a_id and b_id, both are also foreign keys. Thanks, Amir. -- Posted via http://www.ruby-forum.com/.
2006 Jul 25
2
web services client problem
hi all, i have been trying to study web services using rails so far i succesful with server implementations in REST,SOAP,XML-RPC but the client code is troubling me. i have done most of the coding as per the rails book agile web development i.e implementations of the servers and when i invoke them they give result but when i try to acces them through another controller it gives time out error
2013 Jul 19
12
Rails 4 "belongs_to: record" association doesn't work
Hi, I discovered a weird behavior when using a "belongs_to: record" association in Rails 4. Given two models A and B: class A < ActiveRecord::Base belongs_to :record, class_name: ''B'', foreign_key: ''b_id'' end class B < ActiveRecord::Base end When creating A, it inserts a record in B and returns A with id of nil: irb(main):001:0>
2011 Apr 11
4
Printing field attributes outside the model.find_by_sql
Hi All, I have Model called pays..and it has fields like(id, topic, subject, created_at, b_id) and i also have a Model called suggests with fields(id, income, price, b_id) In my ruby on rails action or method Controller: def print_two_table @p = Pay.find_by_sql("SELECT p.id, p.topic, s.id, s.income, s.price FROM pays as P LEFT OUTER JOIN suggests AS s ON s.b_id = p.b_id WHERE
2006 Dec 30
2
search on multiple table
Hello, I am trying to make a search, using acts_as_ferret on a has_and_belongs_to_many relation : class a < ActiveRecord::Base belongs_to :b has_and_belongs_to_many :c Joboffer.find_by_contents( query +b_id:1 ) is working fine but Joboffer.find_by_contents( query +c:1 ) is not working Here are the tables descriptions: Table a have field : id, b_id Table b have field : id,
2006 May 17
2
Association data clobbering (foreign keys too?)
Can someone please confirm or correct the following statements? If I have the following tables create table as (id int, [...], b_id int); create table bs (id int, [...], a_id int); create table as_bs (a_id int, b_id int); and the associations woould be defined like this class A << ... habtm :bs belongs_to :b end so my Model A has a habtm collection of Bs *plus* a direct
2006 Jan 27
1
"Conditional" match?
I have two datasets, big and small. s_date<-c(?2005-12-02?, ?2005-12-01?, ?2004-11-02?,?2002-10-05?,?2000-12-15?) s_id<-c(?a?,?a?,?b?,?c?,?d?) b_date<- c(?2005-12-31?, ?2005-12-31?, ?2004-12-31?,?2002-10-05?,?2001-10-31?,?1999-12-31?) b_id<-c(?a?,?b?,?c?,?d?,?e?,?c?) small<-data.frame(date_=as.Date(s_date),id=s_id) big<-data.frame(date_=as.Date(b_date),id=b_id) For each row
2007 Mar 26
4
a very small query
Hi All what is the command to give me the listing of the loaded packages. I mean which are active and not the listing of all the installed packages as given by library() thanks in advance -gaurav ============================================================================================ DISCLAIMER AND CONFIDENTIALITY CAUTION:\ \ This message and ...{{dropped}}
2007 Nov 20
2
ntp queries not being answered
Hello All, My name is Gaurav, and I am tasked with configuring a linux box with NTP. I am having a problem that I hope you can help me with. We have installed CentOS V5 on 1 processor down in the lab. The rest of the processors on the network are AIX boxes versions 3.2.5 and 5.2. I worked through the entire initial NTP configuration; setup the /etc/ntp.conf file to point to the server, etc.
2010 Mar 08
4
Centos 5.4 DNS resolution issue
I can ping the google.com ip addresses (209.85.231.104) but can't ping the FQDN, obviously DNS is broken. I can also ping the nameserver ip addresses specified in /etc/resolv.conf. -- Gaurav On Sun, Mar 7, 2010 at 10:48 PM, Gaurav Nangla <gaurav.knangla at gmail.com>wrote: > Hi Everyone, > I've setup a Centos 5.4 (x86_64) box in a VM recently; the trouble is I just >
2011 Feb 19
2
Active Record Query
A course has many lessons and a lesson has many topics. A topic can have a recipe or vice versa, a recipe has many topics (optional). I need to come up with the most efficient way of querying the database to find those topics belonging to a course (via lessons of course) which have a recipe (in other words recipe_id is not null for this topic record). Simple but challenging :) Thanks for your
2011 Dec 27
1
sub query issue with active record.
i can manage the MySQL queries into active record.but in some cases basically with sub-queries.i didn''t get the correct output. here when i trying to change the MySQL queries into active-record. *MySQL Query* *select count(*) from ( SELECT transactions.loyalty_id FROM transactions JOIN loyalties ON (transactions.loyalty_id = loyalties.id) where loyalties.created_at >
2006 Mar 15
1
push_with_attributes not inserting default values
I have a join table A_B with columns[a_id, b_id, c_data default 1, d_data default 1]. If I do: @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0}) I find that the row inserted, has d_data set to 0 and not the default value specified in the database, which is 1. So I am having to explicitly set it using : @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0, :d_data => 1}). Is this