similar to: like clause for find

Displaying 20 results from an estimated 10000 matches similar to: "like clause for find"

2006 Feb 07
3
in place edit, save on blur
I thought I''d seen some discussion on this, but can''t find it. I have a text area that I''d like to save on blur unless the user clicks cancel. Anyone got a nice example of this? It''s non-obvious to me how I force the submit via javascript. Thanks, pt. -- Parker Thompson http://www.parkert.com/ 510.541.0125
2006 Jan 24
2
webrick and in_place_editor_field
I''m having a strange problem with webrick spinning forever. I have a view ''list'' that renders a collection: <%= render :partial => ''item'', :collection => @items %> The item partial looks like so: <div id="item_<%= item.id %>"> ... <div id="price"> <%= in_place_editor_field :item, :price
2006 Jan 25
2
inserting column headings between grouped rows
Hello all, I have what is conceptually a pretty simple poblem, but can''t think of an obvious solution. I have a group of objects (@items), that I wish to render as rows. Items have dates, and I wish to group them by that date, inserting a header row each time the date changes e.g.: header row row 11/11/2004 row 11/11/2004 header row row 11/23/2004 I''m currently
2006 Feb 06
1
template choice error (layout.rb)
Hey, I installed the rjs plugin yesterday and started using it for one set of views. Today I notice that in an entirely separate controller/template I''m seeing this error: TypeError (can''t dup NilClass): /vendor/plugins/javascript_generator_templates/lib/add_rjs_to_action_controller.rb:41:in `dup''
2006 Jan 13
1
missing Enum class (windows install)
Hey, mac died this week (launch is Monday), trying to deal by getting Windows set up for development. I''ve got everything up and running, but when I try to hit my app I get an "unitialized contstant Enum error". Sure enough, enum.rb doesn''t exist (according to windows search) on the machine. Now I''m trying to figure out how to fix this. I installed Ruby by
2006 Feb 07
1
Re: keeping plugins up to date [was: template choice error (layout.rb)]
n 2/6/06, Cody Fauser <codyfauser@gmail.com> wrote: > Parker, > > I had missed one of the patches from the Rails trunk, but that is > fixed now. Try checking out the latest version of the plugin from the > svn repository. The problem occurred when using render :layout => > false. The latest revision is 17. Let me know if you continue to have > problems with the
2006 Apr 11
5
Reading MySQL rows
Hi there, I?m having difficulties reading the content of some rows in my database. Tried to use some of the code at page 221 in the pickaxe, but didn?t make it work. The SQL query works fine directly against the database. mysql> select id, count, company from users where name = "martin"; +----+-------+------------+ | id | count | company | +----+-------+------------+ | 1 |
2006 Jun 05
0
testing actionmailer from a controller
Hello, Our application sends e-mail using a number of templates based on the situation. We would like to test that the appropriate template is getting rendered based on the controller state. assert_template would work to test which template is being rendered to the browser. But this doesn''t tell us which template was used to send the e-mail. Anyone have a solution to this problem?
2006 Mar 21
0
Job - San Francisco
Tom (below) is looking for 1-2 programmers in SF that know rails or have a strong background in web & OO development and want to learn. ---------- Forwarded message ---------- "thomaspaynejr@yahoo.com" has forwarded you this craigslist.org posting. Please see below for more information. ________________________________ Do you like wine? C''mon, of course you do! We are
2005 Dec 24
0
acts_as_taggable - adding users and normalizing tags
Hey all, I''m wondering how people are using acts_as_taggable. Two things I''d like to do that aren''t supported out of the box are tag normalization and user attribution. I can''t imagine I''m the first to think about doing this. >From a schema perspective these things both seem simple, just put the normalized tag in the tags table, and have a join
2007 Dec 28
11
LIKE clause in rails
Hello, I am trying to achieve a search functionality in the following manner i have an table called people which has first_name,last_name,etc... After the user form to search people is submitted i get the params hash as params[:persons]={"first_name"=> "%John%","last_name"=>"%Stevens%"} NOTE : I have changed the params hash to include the %. Now
2006 Jul 30
3
Accessing @org.id yields internal number, not record id
With apologies, I can''t figure out the simplest thing: How to reference a record id instead of the internal memory location of that value. I''m new to Ruby but otherwise a veteran VB6/SQL programmer. My code: <snip> sSQL = "SELECT id, org_name FROM organizations WHERE user_id = ''#{sUserId}'' AND user_password =
2006 Jan 03
4
Would someone like to tell me why this code will not solve my problem? (it''s short)
I am building an invoicing system but cannot use the auto_increment field to determine the invoice number (because they are running 3 different companies off the one system. I need to find the last invoice number from any given company and then add 1 to it to get the next invoice number. BUT, there is a unique case on the very first invoice produced because there is no earlier invoice
2006 Apr 26
2
two layers of has_many
Hi, There are many companies. Each company has many departments. Each department has many employees. The following find_by_sql method seems awful. What is the best way to get all the employees of a company? class Company < ActiveRecord::Base has_many :departments def employees Employee.find_by_sql("SELECT employees.* FROM companies, departments, employees
2011 Dec 07
5
Find_by_sql help?
How to make it work with paginator (kaminari)? MySQL and full text search: Words (id, word) @words = Word.find_by_sql(["SELECT id, word, MATCH (word) AGAINST (?) AS Score FROM words WHERE MATCH (word) AGAINST (?) ORDER BY Score Desc, word!=?", params[:search],params[:search],params[:search]]) I can''t add .page(params[:page]).per(5) to the end of "find_by_sql()" so
2006 Apr 21
5
Simple Question: How to merge SQL results?
Hopefully an easy one, how do I merge two or more SQL query results? Example: result1 = find_by_sql(x) result2 = find_by_sql(y) What is the best way to merge result1 and result2? I want to be able to reference the objects as if they were obtained via one query. Cheers, Dan
2006 Jun 30
3
type casting
Hello, I have a user table linked to the login code that was in the "Agile" book. When someone signs in they are assigned to a group, such as "adult" or "teenager". I would like to take this group string and reference a table with "find_by_sql()" so that: (group.capitalize).find_by_sql() would work (and, of course, in the select request in the
2007 Jan 20
2
find_by_sql with named parameterized sql
I tried to use named parameters in my SQL query , using find_by_sql Order.find_by_sql ([select * from orders where amount > ? and quantity > ?", [ @amount, @quantity ] works;.. but Order.find_by_sql ([select * from orders where amount > :amount and quantity > :quantity ", [ :amount => @amt, :quantity => @qty ] is not working a I wrong or should I use a plain select
2010 May 07
1
undefined method 'find_by_sql'
Why would I get an undefined method `find_by_sql'' for #Example: 0x981a4e4> for error when trying to use the find_by_sql method in my model? def init_dictionaries tables = find_by_sql( "SHOW TABLES FROM thesaurus" ) @@tables = tables.collect{ |t| t.Tables_in_thesaurus } end -- You received this message because you are subscribed to the Google Groups "Ruby
2005 Oct 28
4
find_by_sql column types
Hello-- There must be a better way to do this. I have a class method in my model that finds averages and does a few calculations using find_by_sql. The problem I¹m encountering is that all computed columns from MySQL come back as type string. E.g., def self.find_averages(domain_id) if @@domain_average return @@domain_average else @@domain_average =