Thursday, December 2, 2010

Creating the malaysian facebook ;) [Rails 3 Relational database example]

Scaffolding the structure of the application
first generate the scaffolding.(bloody easy on Ruby on Rails)
rails g scaffold user name:text address:text
rails g scaffold post msg:text user_id:text
rails g scaffold comment msg:text user_id:text post_id:text
Creating a relational database
Second is the model configuration

#inside akob/app/models/comment.rb
class Comment < ActiveRecord::Base
belongs_to :post

#inside akob/app/models/post.rb
class Post < ActiveRecord::Base
has_many :comments
belongs_to :user

#inside akob/app/models/user.rb
class User < ActiveRecord::Base
has_many :posts
has_many :comments, :through => :posts
validates :name, :presence => true

this is just an example, we should put many MANY validation to assure this system reliability. inside this example it shows how the data is relate to each other.

this is the screenshot of the console testing which shows the data relationship is working fine. ;)
Actually this is part 1. In the next post, I will move onto the view files & show to you guys how it works with ajax.
Would like to here some respond from you ;)

Wednesday, November 24, 2010

Breeding DNSCELL

Salam & hi readers. Its been a while since the last time I blog. I just moved to shah alam nearly a weeks ago. I stayed at Puncak Perdana in a 'bujang house'. My housemate is the student of filming or some sort of production line at UiTM. Doesn't matter what is their interest, I'm fine with that. The comfortness of my living over here is just fine.

The purpose i moved here is to work with my comrade on developing a networking device (DNS server). What is DNS server ? U can google it your self here. My job is pretty much on the user interface & at the same time, i have to write codes to it. This user interface is accessible through Web browser (which methods used by most of devices nowadays). To be productive i need to master several language such as :
1. html
2. CSS
3. Ruby on Rails3
4. Yahoo User Interface (YUI sytax)

The toughest challenge is to get along with Ruby on Rails3 since the entire architecture is based on it! What is interesting is, RoR has the capability to develop application in a blistering speed & in a secure framework. You can check out the screencast & start to experienced it yourself ;)

Lets hold our RoR stories & get back to DNSCell. Firstly is about the logo, the previous logo looks like this :
On my thought, this logo is not ICONIC & doesn't have much meaning. So I keep on fantasizing & I've learned that honey comb is also a structure of cell. I've created the new logo which looks like this :
Why I think this logo is better ?
1. It is more ICONIC
2. It's pointing towards & upwards, which is we want our business heads to.
3. It's like a plasma canon. Weapon for us to step forward.
4. the logo itself was develop by the name cell (honey cell)

Lets move to the Layouts. I've been practicing alot with css because its been a while since the last time i do CSS -ing. The 1st layout I've produced looks like this :

I looks a bit clumsy & lousy for me. After observation at google apps, i think it's much more clearer & easy so use. So i've produce this :
DNSCell latest layou
Drop down menu & tabs navigation

Before i've forgotten, the oldest layout that amir propose to me is this :
I can see the tab is overlapping & i don't think this may provide easy navigation. User will caught up 'pening' using this UI.

Yesterday I caught up lost inside my own CSS file & I've found out the solution for it, which is by documenting my own CSS. I've had rebuild my CSS. Heres how my mapping looks:
DNSCell CSS plan
And here's how the coding will looks like :
a-a a-b a-c and going to b, c, d. Kinda cute huh? ;)
Would like to hear some response from you guys & will write more about this project on later progress.

Ya'kob Ubaidullah

Monday, November 15, 2010

My Ruby On Rails life ; Installing & tutorial for Rails3 on Ubuntu 10.10

I was really interested to start my 'ruby on rails' life since amirharis introduce it to me. Ive been watching its screencast & cannot wait to start my first application. Below are the few steps to install RoR development environment on Ubuntu:

I am now installing it on Ubuntu 10.10. Before we start our ruby installation, there are few library to install
before that, we want our packages library to be updated.
$ sudo apt-get update
$ sudo apt-get install gcc g++ build-essential libssl-dev libreadline5-dev zlib1g-dev linux-headers-generic libsqlite3-dev curl git libmysqlclient15-dev
We also need RVM to install Ruby for us & for future ease of arrangement. We also need to set the default ruby version.
$ bash < <(curl -s

$ [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
insert line below into your home .bashrc  . Insert it at the bottom of the file.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 
and you may want to restart your terminal for this to take effect
$ rvm install 1.9.2
$ rvm --default use 1.9.2
Now we use Ruby Gem to install rails for us. Gem is Ruby package manager.
$ gem install rails
Here is where our adventure begins! 1 - 2 - 3 Finished creating fully customized database scaffolding with rails!
$ rails new my1stproject
$ cd my1stproject
$ bundle install
$ rails generate scaffold Users name:string address:text phone:string
$ rake db:migrate
$ rails server

Ruby on Rails3 demo

Please visit the ruby on rails official screencast page to watch the video tutorial
Please do correct or do share with me if you experience something weird or there is a mistake in my method.

Saturday, October 2, 2010

New gen2

How about if proton release its new gen2 looks like this

Thursday, July 22, 2010

Hari Mesyuarat Agung Koperasi Kolej Poly-tech Mara Alor Setar

semalam hari rabu, ada mesyuarat kopmas. Smua ahli kopmas tmsuk pelajar & lecturer hadir. Adela dlm 600 org. Ada 1 msalah pda harini, iaitu makan lambat gile punye. Aku pnyela kebuluran smpai tgn dah peluh sjuk2 dah. Br aku tau cmtu rpenye simptom2 kebuluran. Muke kwn2 pun dah 50 50 je tggl. Aku pn silap x lapik prut lansung. Dari pagi mkn kuih dlm bilik mesyuarat je. Adoi

Pengajaran untukku +1....
Rakyat jelata berdoyon doyon. XD
Fariz battery kong
'sayang abg rindu kat sayang la'
Amir dah 50 50 on hand rail dah
aku slpas meeting. mata besaq tu ja boleh.

Saturday, July 17, 2010

aku pergi ESQ 165 Leadership training

training ni mmg xtra0rdinary. Mampu menumbulkan hidayah kepada anda
yang didalam kegelapan. Mengingatkan kita siapa diri kita sebenarnya &
siapa pencipta alam semestaraya ini supaya kita tidak leka & lalai.

Wednesday, July 14, 2010

Apa orang nak kata ?

ha.. Dah nmpak buruk dah cover plastic laptop aku ni. Tapi aku nak
taped dia gak. Ape org nak kate Ade Aku Kesah? (AAK) huahuahua

Plate number KLIA

Petang tadi lepas balik dri kelas, mateku tersangkut kat sbijik kereta
wira ni. Dalam hati duk mengata, "canggih beno no plate.. Kete wira
jek." huahua