Displaying 20 results from an estimated 2000 matches similar to: "Simple search on joined table"
2006 Mar 10
5
case insensitive search
I am having trouble with a simple gallery search.
I type in a segment of the address and i only
seem to be getting results if I use the correct case.
This is in my Gallery controller:
def search
@gallery = Gallery.find(:all, :include => :property,
:conditions => "address LIKE ''%#{@params[:keywords]}%''")
end
On a different note:
I am having
2007 Jul 24
4
spec''ing helpers that use controller
Hi all,
I''m in the process of creating rspecs for my helpers. One of the
helpers in app/helpers/application_helper.rb looks like this:
def page_name
@page_name || "Define @page_name in
#{controller.controller_name}::#{controller.action_name}"
end
The rspec is simply:
it "should something" do
page_name
end
2006 Jul 25
2
Model relationship confusion ...
Hi all,
I''m thinking this must be pretty straightforward, but I''m finding
myself kind of going in circles in trying to model a simple "private
messaging" app.
I have two models: user and message
User
has many messages
Message
has a sender (User)
has many recipients (Users)
I''m at a bit of a loss as to how best define the relationships that
occur in
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
Hi all,
I feel like I''m missing something really easy and I''m just not seeing
it.
I''m using the restful_authentication plugin and have a User model. Uesr
has_many :things and Thing belongs_to :user.
That''s it.
I did a "script/generate rspec_scaffold thing" to generate all the
necessary bits. The "rake db:migrate" to create the db.
At
2006 Jul 14
5
Acts_As_Taggable Plugin multiple controllers.
I have Acts_As_Taggable Plugin working. I have a HR controller and a
sales controller.
I have a document in hr tagged whitepaper and a differnent document in
sales tagged whitepaper
when I am in hr I see the hr document tagged with whitepaper and not
the sale document (what I want). but if I click on the tag whitepaper
I return two documents, hr and sales. I just want to return the hr
document
2007 Jan 16
1
eSATA
Has anyone ever triend to hang a eSATA drive chasis off oc a centos box?
Not specifically this box, but something like this....
http://www.compsource.com/ttechnote.asp?part_no=DS1220&src=F
I have used internal SATA drives on 3ware cards before without an issue.
Didn't know if this was in the same arena.
Thanks!
Andrew
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone,
I have this code:
@person_pages, @people = paginate :person, :per_page => 20,
:conditions => [ "username LIKE ? OR first_name LIKE ? OR
last_name LIKE ? OR preferred_name LIKE ?",
"%" + params[:q].downcase + "%",
"%" + params[:q].downcase + "%",
2006 May 02
4
useful bit of code (hopefully)
Hi,
I often find myself using bits of code like this inside ActiveRecord,
perhaps it''s useful for others, or others can improve on it:
###########
# fix user input before validating it
before_validation :sanitize_input
# santize input before actual validation is called
# this uses the little methods defined below
def sanitize_input
trim %w(adres postcode woonplaats email naam
2012 Sep 20
4
access controller's object attributes in view page
Hi,
I am new to ROR and learning it. In my controller I have an admins
record and I am passing that admin object to the admin''s view page to
get the name of the admin. But when I try to access the name it is
showing error as "undefined method `name'' for :current_admin:Symbol"..
Please help..
Please find my code below
Sessions Controller
def create
2007 Nov 02
11
xrcise tutorial, undefined method ''upper_bt''
Hi
I''m trying to follow the tutorial on xrcise at
http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise
But I keep getting the following error when I try to run the example;
tutorial.rb:21:in `initialize'': undefined method ''upper_bt'' for
#<CaseChangeFrame:0x2d610f8> (NoMethodError)
from tutorial.rb:28:in `new''
from
2006 Dec 27
10
Mixing html tags and Ruby blocks
I''m trying to get the following idea to work:
<%= @column_names.each { |t| <td> t.downcase </td> <td>
@listing.send(t.downcase)</td> } %>
Essentially I want to display a form that has a left and right TD, with
the left TD being a column name and the right TD being the column data.
If there''s a better way (the Rails way ?), I''m all ears
2006 Sep 05
4
No matches
The following script creates a search index and then searches it. I get
no results? Where am I going wrong?
Thanks.
-----------BEGIN SCRIPT----------------
require ''rubygems''
require ''ferret''
include Ferret
path = ''/tmp/myindex''
field_infos = Ferret::Index::FieldInfos.new()
field_infos.add_field(:name, :store => :yes, :index => :yes)
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all
I am wondering how rails handles case sensitivity in databases. If I
do a Person.find_all_by_name("tim") in mysql I would expect to get
tim, TIm, and Tim. Do I only get tim in postgres?
How do other people deal with this? Do you resort to find_by_sql for
all your postgres queries to get case insensitive results?
2006 Jul 15
2
FieldQuery not returning anything
Hey ..
The QueryParser RDoc page explains to me on how to search for a specific
value in a specific field. This is not working the way i thought it
should be, what am i doing wrong? Here''s an example ..
I''m storing model data in the index like this:
doc << Field.new( "object_id", object.id, Field::Store::YES)
doc << Field.new( "type",
2006 May 30
3
match operator in find
Greetings!
Is there some special syntax required to use the match operator (=~) in a find operation? Or is it not possible? I''ve got some data items from an external source that could be capitalized or not. So right now I''m stuck with doing:
Item.find(:first,
:conditions => ["name = ? or name =?", Potatoes, potatoes])
I''d prefer to do:
2006 Sep 23
8
svn problems
I can consistently segfault the 0.10.4 gem, so I''m trying to get the
subversion version working with hopes towards tracking the problem down.
I have a fresh SVN checkout but:
a) the version (in ferret.rb) claims to be 0.9.6; and
b) Ferret::Index::FieldInfos and a couple other classes are missing at
run time. It looks like this is because they''re not exported in the C
2012 Oct 02
3
case insensitive inclusion validation
I want to add case_sensitive option to inclusion validation. This will
allow to do:
validates :numbers, :inclusion => { :in => %(One Two), :case_sensitive =>
false }
Does it make a sense?
Thanks.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit
2010 Dec 30
4
perl code to remove newlines
Given an HTML file which looks like this:
--------- begin snippet ---------
<HTML
><HEAD
><TITLE
>We've Lied to You…</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Maximum RPM"
HREF="index.html"><LINK
REL="UP"
2005 May 23
1
has_and_belongs_to_many dual insert error ?
Hi !
(See references at the end)
I have a slight problem. Whenever I save one of my domain models, which
contains an has_and_belongs_to_many relationship with another one, the
relationships are doubled.
My domain is a series of pictures, where each picture can be tagged with
one or more words. So, a picture of my dog could be tagged "Jordy, Dog,
Dog 2005", for example.
In my
2004 Dec 16
4
Polycom SIP Phones
Could someone please direct me (via personal email) to a provider with
good prices on Polycom Soundpoint IP 500's with POE cables? I need 14
of them.
Thanks,
Adam
________________________________
Adam S. Robins
Executive Vice President & CIO
PHARMACENTRA, LLP
5901B Peachtree Dunwoody Road, Suite 380
Atlanta, GA 30328
Office: 770-395-0088 x34
Fax: 770-395-0989
Mobile: