Thankyou very much.

> def search
>  t = params[:search][:query]
>  @q = Model.find(:all, :conditions=>["title like ? AND url like ? AND
> description like ?", t,t,t"])
> end

Can you explain me this part again?

description like ?", t,t,t"])

what is the t,t,t " in this code ?


regards,

koko




On Tue, Jul 21, 2009 at 6:36 AM, Rails
List<[email protected]> wrote:
>
> Salai Koko wrote:
>> Dear All,
>>
>> Can you guide me how can i implement a search function in my simple
>> Bookmark program. In my Bookmark I have "title" and "url",
>> "description". What I want to do is "search_by" "title".
>>
>> many thanks in advance,
>>
>> regards,
>> koko
>
> view:
>
> <%form_for :search, :url => {:action => 'search', :controller=>'aaa'} do
> |f| %>
>    Search:
>    <%= f.text_field :query %>
>    <%= submit_tag "Search" %>
> <% end %>
>
> Controller:
>
> def search
>  t = params[:search][:query]
> �...@q = Model.find(:all, :conditions=>["title like ? AND url like ? AND
> description like ?", t,t,t"])
> end
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to