In the previous section we were only showing restaurants in Chicago. If you noticed, it was hardcoded in the URL itself and was not generic. In this section we will make the application more generic and allow the user to search data based on a parameter city.
restro_controller.rb as follows:
class RestroController < UITableViewController def viewDidLoad super @restaurants =  searchBar = UISearchBar.alloc.initWithFrame(CGRectMake(0, 0, self.tableView.frame.size.width, 0)) searchBar.delegate = self; searchBar.showsCancelButton = true; searchBar.sizeToFit view.tableHeaderView = searchBar view.dataSource = view.delegate = self searchBar.text = 'Chicago' searchBarSearchButtonClicked(searchBar) end def searchBarSearchButtonClicked(searchBar) ...