knayan2005 / gettext-js

Automatically exported from code.google.com/p/gettext-js
MIT License
0 stars 0 forks source link

AJAX request for PO files fails when used in RoR application #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use gettext.js in Ruby on Rails app
2. put PO files in the public/ folder of the app (i.e.
public/locale/bg_test.po)

PO files are expected to be fetched by AJAX requests. However, under RoR
the AJAX request fails with the following error:
ActionController::RoutingError (No route matches "/locale/bg_test.po" with
{:method=>:post})

This can be fixed by specifying in gettext.js that request method should be
'get'. (it is 'post' by default)

Also small fix for compacting the array in this.links in case there are
other link elements for stylesheets for example.

patch attached.

Original issue reported on code.google.com by denitsa....@gmail.com on 10 Apr 2008 at 10:41

Attachments: