i am having some products in a database(mysql) n i have done the scaffolding and added a search.
So when i search, if product found then it shud display it and if not found it shud redirect to create page.
Here is d controller code for find i used
i am having some products in a database(mysql) n i have done the scaffolding and added a search.
So when i search, if product found then it shud display it and if not found it shud redirect to create page.
Here is d controller code for find i used
i am having some products in a database(mysql) n i have done the scaffolding and added a search.
So when i search, if product found then it shud display it and if not found it shud redirect to create page.
Here is d controller code for find i used ___________________ def find
@products=Product.find(:all, :conditions => ["item LIKE ?",params[:search_string]])
Test for @products.count == 0 here and use redirect_to to go the appropriate action
Colin