Backup of SVN repository
May 1, 2009
Backup of SVN repository,
svnadmin dump myrepos > dumpfile
Once you give this command, it will create the dumpfile (backup) of the SVN repo with all the LOGs.
Load the SVN dump file on server,
svnadmin load newrepos < dumpfile
Once you give this command, all the data from the dumpfile will be loaded/extracted with all SVN LOGs.
Reference URL – http://chestofbooks.com/computers/revision-control/subversion-svn/Migrating-Repository-Data-Elsewhere-Reposadmin-Maint-Migrate.html
How to create rails application for specific rails version ?
February 6, 2009
How to create rails application for specific rails version ?
If you have multiple Rails versions installed on your application and if you want to create Rails application,
rails demo
then in this case, it will create Rails application with latest version installed on our machine.
If you want to create Rails application for specific rails versions, use following command
rails _2.1.0_ demo
demo – rails application name with version 2.1.0
‘cycle’ css-related feature of Rails
January 14, 2009
If you want to display the list ( of users ) with different css-class for alternate record, there is no need to check the odd-even records,
For this, Rails have awesome feature and that is – ‘cycle’
We can use this as,
say we have 2 css classes-blank and white. If want to apply ‘black’ and ‘white’ class for alternate user record, then we have to write the code as,
<% @users.each do |user| %>
<li class="<%= cycle('black', 'white') -%>">
<%= user.name %></li>
<% end %>
Cool feature
Creating Sub Controllers in RubyOnRails
January 14, 2009
Previously I was adding most of the code in one controller…say if there is admin module, and there are different sections in it, then it’s better to add the code in separate controllers – sub-controllers.
Here is the way to create sub-controllers,
ruby script/generate controller admin/users
It will create users_controller.rb in /controllers/admin folder (sub-folder for controller)
Your user controller will look like,
class Admin::UsersController < ApplicationController
end
And to inherit the properties of the parent controller (AdminController), you can change parent controller as AdminController instead ApplicationController
class Admin::UsersController < AdminController
end
Hope this helps.
Protected: Soon Coming with complete Info…
December 23, 2008
Copy/Move files in SVN repository
December 1, 2008
To copy a file/directory in working directory or in otherdirectory,
svn move SOURCE DESTINATION
if you want to move ‘app’ folder from working directory into /trunk,
svn move app /trunk/app
it will move ‘app’ folder in ‘/trunk/app’ folder.
Similarly to copy the files,
——————————————–
svn copy SOURCE DESTINATION
if you want to copy ‘app’ folder from working directory into /trunk,
svn copy app /trunk/app
it will copy ‘app’ folder in ‘/trunk/app’ folder.
Android ?
November 22, 2008
Android ………Will post in details soon..
ri and rdoc in Ruby On Rails
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.
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 " ) %>