views:

17

answers:

1
  def search_results
       @keyword = request.raw_post
       @tutors = Tutors.find(:all,:conditions => ["first_name LIKE ?", '%' + "raul" + '%'])    
  end

I am trying to get some information out of request.raw_post

But it is giving me this long thing

authenticity_token=HxxkPMpSr0kHZOVZIYbpMti217BTeUa5G2vX8zbs8ig%3D&keyword=alex&authenticity_token=HxxkPMpSr0kHZOVZIYbpMti217BTeUa5G2vX8zbs8ig%3D

Baiscally I just need where it says Keyword=alex I just need alex. Or whatever is after keyword= in that thing above. So, that I can use it in my query. Any ideas.

A: 

If you want that value, I would suggest params[:keyword].

Or alternatively, request.raw_post.split(/&/).grep(/keyword=/).first.split(/=/).last

Jason Noble
yea, that is exactly what I did.
Alex