Request.raw_post is trying to extract data from it.

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

I am trying to get some information from request.raw_post , but it gives me this long line: "authenticity_token = HxxkPMpSr0kHZOVZIYbpMti217BTeUa5G2vX8zbs8ig% 3D & keyword = alex & authenticity_token = HxxkPMpSr0kHZOVZiybeTviGiBtiViZiBtiViZiBtiViZiBtiViZiBtiViZiBtiViZiBtv.

Basically, I just want to get "alex" which says "keyword = alex". How can i do this?

0
source share
1 answer

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

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

+1
source

All Articles