similar to: Doing a simple search from the database?

Displaying 20 results from an estimated 1000 matches similar to: "Doing a simple search from the database?"

2006 Jun 13
9
Find DB items by "title"
I''m having trouble finding then displaying all items in my "posts" table that match a certain search string. I have a from field: <%= start_form_tag :action=> "search" %> <div title="Search" id="searchform" class="form"> <h3>Search</h3> <%= error_messages_for ''post''
2006 Jun 14
1
Partial matches with find_by
I have a form passing a parameter to a "show_search" action. Everything goes fine, as long as i search for the exact title of the post. How do I do a partial or "wild card" search? Code below: def show_search @posts = Post.find_all_by_title(params[:title]) end -- Posted via http://www.ruby-forum.com/.
2006 Jun 25
1
Using AND in :conditions queries
I have what amounts to a simple search engine running through a table using input from a form. Everything works fine when looking for "title" or "body" But, when I want to couple that with an AND statement the search still works fine, but it seems to disregard the AND statements. Code below: In the view: <%= start_form_tag :action=> "show_search" %>
2006 Jun 27
3
start_form_tag question..
i am trying to get a start_form_tag working, but i am shooting blanks.. here''s what i am trying to do.. i have a controller called "forms.." with an action "new_entry".. it is called by: localhost/forms/new_entry this is just a quick form to test another action.. that action is: localhost/logger my question is, how do i construct start form tag in order to
2006 Jun 27
4
File Column has me stumped
I have an existing entry in my DB under the "users" table that has a column name "pic". I have a file column field when a new user signs up, and it work great. I am now trying to give existing users the ability to add or change their "pic". But, no matter what I do the entry comes up blank. Here''s what I have so far: View: <%= start_form_tag ({:action
2008 Jun 18
4
clear search box the first time it's selected
Hi - I''m trying to implement a search box that has a pre-filled message "enter search text." The first time it''s selected, I''d like it to clear out, but after that, I''d like it to remain. I imagine lots of people have done this, any ideas how to accomplish this? Thanks, Dino --~--~---------~--~----~------------~-------~--~----~ You received this
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 Jun 14
4
Using now() to determine what should be displayed
I''m trying to create a paginated list that will take note of the "end_date" field in my table. This is what I have: @post_pages, @posts = paginate(:posts, :per_page => 10, :order_by => ''end_date'') in the controller. And for the view: <h1>Posts ending soon</h1> <ul><% for post in @posts do %> <strong>Post Title:
2006 Jun 18
3
Ambiguous clause error
I''m trying to query one table to ultimately display the relate info from another table. I have 2 tables: "posts" and "numbers". I''m trying to do a query like this: @numbers = Number.find(:all, :conditions => [ ''(user_id) = :id'', {:id =>
2006 Jun 08
3
Foreign key confusion
I have 2 models right now: "users" and "posts". When a user creates a post I would like their id to be recorded under "user_id" in the "posts" table. Under the "user" model I have: class User < ActiveRecord::Base has_many :posts end And under the "posts" model I have: class Post < ActiveRecord::Base belongs_to :user
2004 Jan 25
3
OH323 doesnt hear ringing
I have Asterisk running with a combination of SIP and H323 clients. I am using the OH323 module instead of the H323 one. When the SIP clients ring each other, they can hear a ringing noise in the ear peice to let them know that the other parties phone is ringing. However, when the H323 client rings a SIP client, there is no ringing sound at all, although as soon as the called party picks up the
2006 Dec 10
5
model-controller-paradigm: What about admin controllers?
Hi all We all know the model-controller-paradigm: I have a model "News" which has a corresponding CRUD-controller "NewsController". But now I''m quite unsure about the following... Guess we have normal visitors that visit our site www.??.com/news and we have administrators that create and modify news items. The admin should see an "Edit" link and a
2012 Apr 10
6
User Association
Please Im trying to create an application where i can post like twitter, but i was the users name to be posted under their respective posts My Post_controller looks like this def index @posts = Post.all(:order => "created_at DESC") @users = User.find(:all) #@user_id = current_user.find(params[:id]) respond_to do |format| format.html end end def create
2006 Jun 25
1
Sorting ferret results by column
I have the acts_as_ferret plugin installed. Everything searches great, but I would like to limit the results (i.e. by ''end_date'') and sort them (by ''end_date''). ''end_date'' is a valid column in my "posts" table. Here''s the code I have already: @posts = Post.find_by_contents(params[:query]) params[:query] comes from a form. I
2003 May 12
3
Limit bandwidth per client
Hi all, I have an installation where each user on subnet 192.168.1.0/24 is connected via a multiplexer. The problem is that if any client uses more than about 48Kb/s, the multiplexer crashes. I need to limit each client to under this rate, say 32Kb/s. I have seen examples on creating a class per host but is there a simple way of saying "any host from 192.168.1.0/24" so I dont have
2006 Jan 17
3
Phone still rings while on a call
Hi All I have some grandstream phones registered to my asterisk and all internal, external, voicemail services etc are working very well. I am not sure that it is a problem more so an annoyance. If someone dials my extension number or external DDI while I am already in a call rather than skipping to the next priority in the dial plan for example voicemail the line continues to ring and while in
2008 Apr 18
1
Polycom LDAP Corporate Directory
Anyone use the LDAP feature yet on the polycom phones? If so how well does it work? How are you using it in your environment? http://polycom.com/usa/en/products/voice/desktop/soundpoint_ip/applicati ons/corporate_directory_access.html Roy Anciso Director of Technology Manistee Intermediate School District 772 East Parkdale Avenue Manistee, MI 49660 Ph: 231-723-4264 Fx: 231-398-3036 roy at
2011 Apr 30
8
"uninitialized constant PostsController::Post"
This time i read scaffold tutorial very carefully and finally try to generate a form without using the scaffold(just used a controller and view ).what i have done till now ,is as follow.Using rails 3.0.7. "rails generate controller posts index" 1) post_controller.rb class PostsController < ApplicationController def index @post=Post.new
2006 Apr 22
3
rjs woes, any hints?
I''ve pared my rjs experiment down to what seems a bare minimum. When I click on my link_to_remote, the rjs executes, returns the correct javascript to the browser, but it doesn''t update the div I''ve specified. What appears to be coming back from the controller is: Element.update("my_form", "hello, rjs"); I''m tearing my hair out.
2004 Sep 17
2
[LLVMdev] Inline Assembly (unique arch string for llvm)
On Thu, 2004-09-16 at 23:45, Chris Lattner wrote: > On Thu, 16 Sep 2004, Andrew Lenharth wrote: > > So I propose that llvm-gcc not consider itself any type of x86-linux (or > > what ever it platform it was compiled on), but rather create a new > > architecture, say llvm (or perhaps 2, one for each bit and little > > endian). Thuse llvm-gcc -dumpmachine would return