views:

633

answers:

2

We're building a Facebook application at work using Ruby on Rails. We're currently switching it from a canvas to an iframe application for technical reasons.

There is however a problem, Facebook sends you the fb_sig_api_key and others as GET varialbes in the URL (blah.com/?fb_sig_api_key=12345&whatever=hello).

However, for some reason, Facebook passes the URL with & between each variable instead of plain &. This causes rails to not get a fb_sig_api_key param, but amp;fb_sig_api_key.

So, is there any setting in Rails which will make it use & and & as GET URL argument separators?

If it was PHP it'd be a quick php.ini change, but we're not, so..... help? lol

(At the moment we're working on a quick and ugly before_filter to remote amp; from the beginning of all params.)

P.S. We're using Facebooker.

A: 

Are you using RFacebook?

Sebastian
No, we're using Facebooker.
jimeh
A: 

I would suggest create another hash in the controller in before_filter too

before_filter :fetch_params_values

private

def fetch_params_values
  # create another hash to handle querystring
  @params = request.query_string.split(/&/)
end
Sikachu