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...............