Tuesday, May 25, 2010

How to open a rails project in netbeans

I have faced this problem when i clone the git repository of sysblitz from server and nbproject directory ignored in .gitignore.

I have copy this code http://pastie.org/322423 in a ruby file and issue the command

$ ruby ruby_file_name  < rails_project_path >   --rails

this command created a directory nbproject in my rails project and now i am able to browse the rails project from netbeans.

Or

Other way is use Netbeans interface to open
New Project(Ctrl+Shift+N) -> Choose Project -> Ruby on Rails Application with Existing Sources .
Now browse the Project directory.

It will open your Rails project in Netbeans.

Wednesday, January 6, 2010

Get the value of selected radio button

In prototype you can use the following code to get the value of selected radio button in a group of radio button.

If you have only one group of radio button in page then use the following code

$$('input[type=radio]:checked').pluck('value');


If you have more than one group of radio button then use following code


$$('input:checked[type="radio"][name="my_radio_group"]').pluck('value');

$$ will get the element input (html tag) which is checked and whose type is radio with name my_radio_group and pluck the value attribute.

It will help you a lot.


Followers