Wednesday, January 25, 2006

Using and defining functions in Ruby on Rail

Simple function definition

def self.home_categories (portal)
end


Calling this function
@categories = Category.home_categories (:current_portal)

Simple find
find(:all,
:conditions => "portal_id=1"#, #date_available <= now()
# :order => "" #date_available desc
)

0 Comments:

Post a Comment

<< Home

eXTReMe Tracker