Forum: Ruby on Rails regarding localization

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fd1cef91d62d8ef3cdeef3cfc19a98f3?d=identicon&s=25 napster (Guest)
on 2008-11-28 15:15
(Received via mailing list)
Im trying to implement localization language options with drop-
down menu button...

here my html code.....

<form action=" " >
       <select id="category"  style="width:226px"
onChange="startRequest();">
                        <option value="0">Select a language</option>
         <%@lang_view.each do|key,value|%>
                 <option value=<%=value%>><%=key%></option>
                 <!--<option value='ar'>arabic</option>
          <option value='hi'>hindi</option>-->
        <%end%>
         </select>
</form>

when an event fires it call the  "startRequest()" method which is
defined in script tags.

<script type="text/javascript">
function startRequest(){
        var xhr;
        var lan_Id = document.getElementById("category").value;
        alert(lan_Id);
        var uri_orig = window.location.href;
        alert(uri_orig);
        new Ajax.Updater('update','get_lang', {
                onComplete: function(request){
                        Element.hide("spinner");
                },
                parameters: 'lan_Id=' + encodeURIComponent(lan_Id)
        })
}

</script>

actually 'get_lang' method is in application controller.

Instead of going to application controller..... it is checking this
"get_lang" method in current controller.("i.e url").

please any one help me regrding this...............
This topic is locked and can not be replied to.