Displaying 1 result from an estimated 1 matches for "myapp_categori".
Did you mean:
myapp_categories
2007 Jan 26
10
Camping and DBI
...require ''dbi''
module MyApp:Models
class DB
def self.dbh
DBI.connect(''DBI:Mysql:dbname'', ''username'', ''password'')
end
end
class Category < DB
def self.find
dbh.select_all(''SELECT * FROM myapp_categories'')
end
def self.find_by_id(id)
dbh.select_all(''SELECT * FROM myapp_categories WHERE id = ?'', id)
end
end
end
module MyApp:Controllers
class Index < R ''/''
def get
@categories = Category.find
render :index
en...