firstruby

Master ruby with us

Archive for November, 2008

Android ?

Posted by firstruby on November 22, 2008

Android ………Will post in details soon..

Posted in Useful Links | Tagged: | Leave a Comment »

ri and rdoc in Ruby On Rails

Posted by firstruby on November 16, 2008

To install ri and rdoc of any gem,

gem install gemname

This command installs ri and rdoc with installation of gem.

To skip the installation of ri and rdoc of gem,

gem install gemname –no-ri –no-rdoc

This command will skip the installation of ri and rdoc when installing gem.

Posted in firstruby, Forum, Useful Links | Tagged: , , , | Leave a Comment »

remote_function or link_to_remote with multiple parameters in Ruby on Rails

Posted by firstruby on November 3, 2008

We can pass the multiple parameters with remote_function or link_to_remote…

<%= link_to_remote "View Data",
:url => :action => "list",
:with => " 'name=' +$('div-id-of-name-text-box').value + '&city=' +$('div-id-of-city-text-box').value + '&country=' +$('div-id-of-country-text-box').value " %>

or

<%= remote_function(:url => :action => "list",
:with => " 'name=' +$('div-id-of-name-text-box').value + '&city=' +$('div-id-of-city-text-box').value + '&country=' +$('div-id-of-country-text-box').value " ) %>

Posted in Useful Links | Tagged: , , | 3 Comments »

Git – create git branch

Posted by firstruby on November 2, 2008

Create new branch “demo” as,

1) git branch demo

This will create local branch “demo”

2) git checkout demo

This will switched to that branch

3) make some changes in that code, then,

git add <files>
git commit -m "<your message>"

4) git push origin demo

This will create new remote branch “demo” on github.

5) If you want someone to checkout the code from “demo” branch, then do following,

git clone <git-path>

then,

git checkout --track -b demo origin/demo

Now, you are in “demo” branch.

Posted in Blogroll, firstruby, Useful Links | Tagged: , , | 1 Comment »

select with :onchange in Ruby on Rails

Posted by firstruby on November 2, 2008

In Ruby on Rails, We can use ‘select’ with :onchange as following code block,

= f.select :my_attribute, @my_values.collect{|a| [a.name, a.id]}, {}, { :onChange => 'remote_function(blabla....)' }

Posted in firstruby | Tagged: , , , | Leave a Comment »