O'Reilly logo

Rhomobile Beginner's Guide by Abhishek Nalwaya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action Filtering data with search

After understanding the search functionality we will now include it in our employee application. We will search employees based on their name and then fetch the results.

To receive the entire data in JSON format, open the following link:

http://employee-rails.heroku.com/employees.json

To implement the search functionality of Rhodes, we will use the search method as mentioned earlier:

  1. Add the following code in employee_controller.rb:
    def search Employee.search(:from => 'search', :search_params => {:name => @params['query']}, :callback => '/app/Employee/search_callback', :callback_param => "name=#{@params['query']}") @response['headers']['Wait-Page'] = 'true' render :action => :searching end def search_callback ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required