i am unable for write query corresponding to text_field value.. The code is: class MainController < ApplicationController def search book=Book.find_by_book_id(params[:query]) redirect_to :controller=>''search'',:action=>''sv'',:id=>@book end end Attachments: http://www.ruby-forum.com/attachment/1577/search.html.erb -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> book=Book.find_by_book_id(params[:query])Try it : @book=Book.find_by_book_id(params[:query]) By creating instance variable it will be accessible to your query field. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reinhart Ariando http://teapoci.blogspot.com MSN: reinhart.showbiz-EMRzualFZlQ@public.gmane.org YM : Booking2Heaven ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---