Category: rails

  • Rails, what’s wrong with serving static JS and CSS files?

    For a new web project, I’ve been looking at Rails 3.1, the latest update of the popular Ruby on Rails web application framework. Although I just started on it, and haven’t seen all the goodness, one thing that raised my eyebrows is how static content a la CSS and JavaScript is handled, through an asset…

  • JQuery AJAX with Rails’ authenticity token

    In Ruby on Rails, authenticity tokens are generated to prevent CSRF (Cross Site Request Forgery) attacks. These tokens generate a unique “identifier” to prevent other website from making requests on your behalf, or so-called “session riding”. In Ruby on Rails, to have this identifier available for you, you need to put in your view, usually…

  • Spaces, or parentheses are important

    In Rails, j = points.size -1 is not equal to j = points.size – 1 Wouldn’t it be easier if Parentheses were mandatory, so that we could see the difference between: j = points.size -1 and j = points.size(-1)

  • FacebookError: OAuthException – Invalid OAuth access token

    On places.ae, we got notified of some issues with Facebook signups and logins. All of the sudden, when the Facebook OAuth service pushed us back to our redirect-page, the HyperGraph Gem threw the following error: FacebookError: OAuthException – Invalid OAuth access token This is often thrown because the Access Token could contain a | (pipe)…