Hi,
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="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
PTS:
This works only inside the app, & not in a HTML file.
Source : http://translate.google.com/translate_tools?hl=en
Thanks,
Srikanth
my blog is abt wht i have learnt technically, mostly in Ruby on Rails, Javascript, node.js hope this share a little bit of info & adds a bit stuff., Thanks.
Friday, November 27, 2009
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,
http://www.box.net/shared/9lo1g8p3ei
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" />
<table>
<tr>
<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>
</select>
<a href="javascript:;" id="add">add >></a>
</div>
</td>
<td align="center">
<div class="holder"><p>Selected Exam </p>
<select multiple="multiple" id="select2" name="selected_exam_list[]">
</select>
<a href="javascript:;" id="remove"><< remove</a>
</div>
</td>
</tr>
</table>
Reference & Demo : http://davidwalsh.name/dw-content/multi-select.php
Thanks,
Srikanth
& what worked for me is i have given below,
http://www.box.net/shared/9lo1g8p3ei
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" />
<table>
<tr>
<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>
</select>
<a href="javascript:;" id="add">add >></a>
</div>
</td>
<td align="center">
<div class="holder"><p>Selected Exam </p>
<select multiple="multiple" id="select2" name="selected_exam_list[]">
</select>
<a href="javascript:;" id="remove"><< remove</a>
</div>
</td>
</tr>
</table>
Reference & Demo : http://davidwalsh.name/dw-content/multi-select.php
Thanks,
Srikanth
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>
Thanks,
Srikanth
<link rel="SHORTCUT ICON" href="/images/favicon.ico" type="image/x-icon"></span>
Thanks,
Srikanth
Tuesday, November 17, 2009
Adding GEM sources
sudo gem sources -a http://gems.github.com/
sudo gem sources -a http://gems.rubyonrails.org/
sudo gem sources -a http://gems.rubyonrails.org/
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 http://gems.github.com
Books : Restful Web Services
| Web Services Essentials (O'Reilly XML)
| Web Services: Principles and Technology
| RESTful Web Services Cookbook
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 http://gems.github.com
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]]
end
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:
http://localhost:3000/post/wsdl
Books : Restful Web Services
Tuesday, November 10, 2009
Getting Next Existing Record in a DB
Wondered how to do it,, & did it Using offset:
sql:
SELECT * FROM foo WHERE id = 4 OFFSET 1
Subscribe to:
Posts (Atom)