similar to: ruby and mysql syntax? tried single quotes, double, none, ...

Displaying 20 results from an estimated 500 matches similar to: "ruby and mysql syntax? tried single quotes, double, none, ..."

2005 Dec 23
2
Bizarre problems with AJAX / missing variables
I''m having some really weird problems with an app I''m writing. Everything is working as expected on my development machine (OSX, Rails 0.14.4) but is cacking out with weird errors on the Textdrive demo site (FreeBSD, Rails 1.0.0). It complains about missing variables, with errors like this: undefined local variable or method `rawcode'' for
2009 Apr 11
6
Inserting data from 1 table to another by using find_by_sql
Hi All, I am inserting data from one table to another by using following method @data=RoyaltyReportFiles.find_by_sql("insert into royalty_reports (artist_name, album_name) select artist_name, album_name from temp_royalty_reports where id=328417") it saves the data into royalty_reports table but it gives following error and application crashes. i am using rails 1.2.5 You have a nil
2006 Jul 27
5
Calculate methods on attr_accessor objects
Is it possible to use the calculate methods (sum, etc.) on attr_accessor attributes? Ie: Class Item < ActiveRecord::Base attr_accessor :total_cost def total_cost @total_cost = self.cost_unit * self.amount end calling Item.sum(:total_cost) or Item.sum(''total_cost'') both return a unknown column ''total_cost'' mysql error. I thought that active
2006 Jul 17
4
how to invoke model methods in controller & vice versa
hello how to invoke model methods in controller & vice versa please explain with examples advance thanx -- Posted via http://www.ruby-forum.com/.
2006 Jan 19
7
bug in has_many count?
I can submit a patch, but wanted to confirm I''m looking at this right... The docs indicate that if you specify a has_many association with :finder_sql, but no :counter_sql, it constructs the appropriate counter sql by substituting the SELECT clause. But has_many_association.rb doesn''t seem to do that -- it just passes Base#count_by_sql the finder_sql, which doesn''t
2006 Aug 13
7
you can pass multiple parameters using link_to? anything bad
i just found out i can pass mutiple parameters from views like <%= link_to doctype.name, :action => "show_towns", :id => doctype.name, :id2 => doctype.id%> silly me, i always had the impression that i could only pass 1. i guess i dont have to use sessions after all for my site. is there anything wrong with this? basically instead of the user filling out
2006 Apr 06
6
pagination question
i''ve figured out how to use the next and previous links with the paginator class but now i''m trying to figure out how to display all the page numbers in between. looking through the rails api, i found paginator.each() but i''m not sure how to use it, or if that''s even what i am looking for. also, is there a way to limit the amount of pages like some sites
2006 Sep 15
1
quotes
Hello! I''m new on this list (and actually pretty new to redcloth also). This e-mail is about the wery fine feature of converting quotes. I''m norwegian, and we have our own qoutes: "?" and "?". I therefore hacked this feature, so it is now in lib/redcloth.rb, around line 404, so I now have: [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/,
2006 Feb 25
5
MySQL client ran out of memory
I''m getting the following error unexpectedly for my rails app. I just exported the databae from dreamhost and imported it on textdrive for my rails app. Mysql::Error: MySQL client ran out of memory: SELECT COUNT(*) FROM comments WHERE (comments.listing_id = 2666) /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract_adapter.rb:88:in
2007 Sep 20
3
Bug? in wxSugar enumerable_controls.rb
Hi, I wanted to use wxSugar enumerable features to add a method for returning checked items'' index to the CheckListBox class : require ''wx_sugar/version'' require ''wx_sugar/wx_classes/control_with_items'' require ''wx_sugar/wx_classes/listctrl'' class Wx::CheckListBox def checked_items # use of find_all method from Enumerable
2006 Aug 06
1
creating hash table, how do i? please help
hi, i have a noob question. how do i create a table but add additional fields? for example.. i have a total_table of total, county, and town where total_table inherites county_id and town_id from my town_county table where county_id has_many towns. in my view, id like to go through the hash like this table total_table for total_table.county { print total_table.county print
2006 Aug 04
1
how to count totals for each unique name in a table?
hello, i am having trouble on how to implement this. i have a table of doctor information where each doctor has a town and county field. i would like to create a view that shows the amount of doctor_types in each town. For example if the user selects the ''General Doctors'' search button, a view like this will show up. The next step would be for the user to select which
2006 Feb 09
2
postgres connection problems
Hello, I''m a newbie to rails and I am trying to do the Demo in the November Issue of Linux Journal. Things go fine go fine until I try to connect to my Postgres database (ver 8.1). At this point I get the following error message ---- RoR error and trace back ---- PGError in Admin#index could not connect to server: Permission denied Is the server running on host "localhost"
2008 Apr 09
1
read table not reading lines containing single quotes
Hi, * I am using read.table command as follow kegg<-read.table("c:/IDs.tab",header =TRUE,quote= "'", sep="\t") * Fragment of file is as follow: ID Pathway 04916 Melanogenesis 04920 Adipocytokine signaling pathway 04930 Type II diabetes mellitus 04940 Type I diabetes mellitus 04950 Maturity onset diabetes of the young 05010
2006 Jan 07
8
Using find_by_sql to get the sum of a column
Hello, I was wondering if there was a method in Rails that returns the sum of a column. For example, I have a column called ''score'' and writing a SQL statement such a ''select sum(score) from table_name'' does return the sum of the values in the column. In the past (not too long ago being a newbie), I defined all sorts of methods only to discover that Rails
2006 May 06
7
New Ajax and Rails tutorial
Hi, I just published the first version of a small tutorial I''ve written on Ajax and Rails. It is called "How to paginate, sort and search a table with Ajax and Rails" (sorry, I didn''t manage to find a longer title !) and is available at : http://dev.nozav.org/rails_ajax_table.html There is nothing really new in it, it''s rather a compilation and
2006 Jul 16
3
pagination over custom-sorted collections?
I have a little web app where we need to paginate collections of items. I''m trying to sort the collection and then pass it, sorted, to a Paginator, and still be able to paginate through the collection, across several pages, with the new sort order. The only thing I''m doing differently from the regular scaffolding approach is this: @order_pages = Paginator.new(self,
2006 May 18
8
Concatenated key
Hi all, I started playing a couple days ago with Rails and it find it very interesting. But I''m a bit stuck with making it work with a concatenated primary key. I want to use my own names for the DB fields and I''m using SQL Server 2005. My tables look roughly like this: CREATE TABLE USERS ( USR_ID VARCHAR(25) NOT NULL PRIMARY KEY, USR_PASS VARCHAR(25) ) CREATE TABLE
2006 Feb 18
1
sql logic is killing me
I know my thinking is sloppy. I want to know how many clients currently in my facility are male... My facilities_controller.rb def list_fac @placement_pages, @placements = paginate( :placements, :conditions => ["placements.facility_id = ?", params[:facility_id] ], :include => [:facility, :client], :order_by => ''facilities.name,
2004 May 22
10
Tabbing between Notebook pages
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: wxTony.rbw Type: application/octet-stream Size: 10436 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20040522/9c1889d0/wxTony.obj