Friday, November 27, 2009

Multiple Language implementation Using Google Translate


Just surfed through how to implement a multiple language App, & got this from google Translate..

Just add this code in your HTML Layout.

<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
</script><script src=""></script>

This works only inside the app, & not in a HTML file.

Source :


Thursday, November 26, 2009

Multiple Select boxes in Js

I have gone through many examples for multiple select like this.

& what worked for me is i have given below,

Download the Js & Css from the above link.

Create a HTML file like this,

<script src="javascripts/moo.js" type="text/javascript"></script>
<script src="javascripts/multi_transfer.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="stylesheets/multiple.css" />

<td align="center">
<div class="holder" > <p>Exam List</p>
<select multiple="multiple" id="select1" name="select1[]">

<option value="1">one1</option>
<option value="2">one2</option>
<option value="3">one3</option>
<option value="4">one4</option>
<option value="5">one5</option>

<a href="javascript:;" id="add">add >></a>
<td align="center">
<div class="holder"><p>Selected Exam </p>
<select multiple="multiple" id="select2" name="selected_exam_list[]">
<a href="javascript:;" id="remove"><< remove</a>

Reference & Demo :


Add Favicon in a webpage

This is how we add Favicon in a webpage,

<link rel="SHORTCUT ICON" href="/images/favicon.ico" type="image/x-icon"></span>


Tuesday, November 17, 2009

Adding GEM sources

sudo gem sources -a

sudo gem sources -a

Action Web Service Gem

hi i am using 'actionwebservice' for passing SOAP requests.

Version 2.3.2 for actionwebservice is " datanoise-actionwebservice"

For installing the gem when i used,

gem install datanoise-actionwebservice

got this error,
ERROR: could not find gem datanoise-actionwebservice locally or in a repository

& found this is the right way to install

gem install datanoise-actionwebservice --source

Add this line to your config/environment.rb file in the initializer section:

config.gem 'datanoise-actionwebservice', :lib => 'actionwebservice'

Generating API controller

ActionWebService gem includes web_service generator that you can use like this:

$ ./script/generate web_service post

Define your API

Open app/services/post_api.rb file and add methods that your service exposes:

class PostApi < returns =""> [[:string]]

API implementation

We are going to use direct dispatching mode, so all methods that implement our API go directly to PostController itself:

class PostController < ApplicationController wsdl_service_name 'Post' web_service_api PostApi web_service_scaffold :invocation if Rails.env == 'development' def get_posts ["Post 1", "Post 2"] end end wsdl url:

Books : Restful Web Services | Web Services Essentials (O'Reilly XML) | Web Services: Principles and Technology | RESTful Web Services Cookbook

Tuesday, November 10, 2009