Archive for April, 2008

ruby rake

Posted on April 21, 2008. Filed under: Uncategorized |

ruby is make like utility.Make utility makes a install with all the options and config you want .Rake is similar to Make
within a rails application go to that directory ask the rake to tell about itself
rake -T
rake rails:freeze:gems
rake doc:rails : will install the rdoc for the rails –> the activerecord#find etc…in the html format in [...]

Read Full Post | Make a Comment ( None so far )

Ruby : Math

Posted on April 21, 2008. Filed under: Uncategorized |

Math is a module which has a lot of useful Methods.
To convert from one class to another just call the class name followed by parameter.
Integer(field)
Float(field)
String(field)
All other method are applied on the object itself like 3.div 3 or 12.divmod 5 which divides and gives the balance. or you can remainder to get the remainder alone.
you [...]

Read Full Post | Make a Comment ( None so far )

rails basics

Posted on April 21, 2008. Filed under: Uncategorized |

render(:controller=>’say’ ,:action=>’hello’)
render(:partial => ‘form’)
redirect(:controller=>’say’ :action=>’hello’)
link_to(‘mylink’,:controller= >’say’,:action=>’hello’,:id=>1)
params.inspect
logger.warn,logger.error,logger.info,logger.fatal
(ActionView only) debug(params)
( FormHelpers only)
<input type =’text’ name=album[title]/> can be written as
<%= form_tag(:action=>’create’) do %>
<%= text_field(:album, :title) %>
<%= datetime_select(:album, :release_date) %>
<%= submit_tag(“name of button”) %>
<%= end %>
form_tag
form
 
error_messages_for(:album) —> debug(album.errors)
validates_presence_of :artist
before_filter(controller) :method nly/:except =>[]
after_filter(controller) :method nly
Model inherits from ActiveRecord::Base which has methods like find,find_by_id,find_by_sql,save,update,destroy
Controller is inherited [...]

Read Full Post | Make a Comment ( None so far )

ruby gems

Posted on April 20, 2008. Filed under: Uncategorized |

http://docs.rubygems.org/read/book/2
gem -v : would give the version
gem list –local : list of all gems in the system with thier version number.if there was 2 version then it would give them in descending order
gem outdated : would give list of gems which are outdate
gem update : would update all the gems.
gem update –include-dependencies –no-rdoc
 
gem cleanup : [...]

Read Full Post | Make a Comment ( None so far )

  •  

    April 2008
    M T W T F S S
    « Mar   Jun »
     123456
    78910111213
    14151617181920
    21222324252627
    282930  
  • My Fav

Liked it here?
Why not try sites on the blogroll...