Wednesday, February 25, 2009

Custom routing in RoR

The index.html.erb view sample

The resources in config/routes.rb

The user_pages.rb controller

The results

Added a feature in Bizonnet, My Pages or List of my SMS Business Location. After the user logged in, they can view,edit or destroy the added pages. And the system will list all the created pages created by them. If the pages spanning way beyond 10 pages, the system will automatically trigger Pagination helper, so the user can flip thru the list of pages using the helpers.

I'm using format. So in the config/routes.rb I have to modify it.

It's so tired..and I need a new haircut by today. Bye

Tuesday, February 24, 2009

RoR Search Engine

The sample controller. Now I can search on 3 different join tables, Tags,Category and Pages

The library

CakePHP Search Controller

Sample controller for typical search in CakePHP

Monday, February 23, 2009

TREE Category Management

Category Tree is very important tool while doing web development. You can create unlimited categories using this technique.

The Tree helper in app/helpers/application.rb

Using it in view

The output while editing page

A very simple Tree Category Management

Thursday, February 19, 2009

Jaring Biz-on-Net

Jaring Biz-on-Net Portal features
1. Tagging for each business
2. Tag Cloud
3. Google Map pointing
4. Auto geocoding using normal address
5. User Management System

Thanks to:
1. Ruby On Rails
2. MySQL
3. Webbring Proxy Apache
4. VMWARE Enterprise
5. Linux Centos

I got this task around 7 days ago and must be finished by today. Thanks for Ruby On Rails, you are life saver. Using the available plugins, make the build from scratch is much easier.

Friday, February 13, 2009

RESTful Authentication

If you are like me, you'll probably finished reading these books

1. Practical Rails Social Networking Sites
2. Simply Rails 2
3. Advanced Rails Recipes
4. Agile Web Development With RoR 2nd Edition

And none of them give an example for complete user management & authentication system. Before you write your own system, follow this tutorial.

The tutorial is so great, my auth system now have these features
1.user registration form
2. manage user roles
3. roles management
4. role checking
5. forgot password mechanism
6. email activation code
7. login/logout

Sunday, February 8, 2009

Video Conversion using Pazera CLI

Thumbnails generated by FFMPEG

The magic command

It works, using WINE and PAZERA free command line video conversion.

Demo site


Linux VPS + WINE + Pazera == Youtube

showing Pazera ffmpeg)x264.exe converting *.mp4 into *.flv and it works

TVCC is cool but it costs money and FFMPEG not working on my linux box but it does on Windows XP.

So here's the solution, install wine, upload c:\pazera folder into your Linux box, and convert the video using wine /root/ffmpeg.exe --args

pazera is free video converter for windows, and it use FFMPEG. Tested with MP4,3GP,AVI ...all the videos can be converted into flv.

Saturday, February 7, 2009

Shop, RoR E-Commerce Store

The Storefront

Shopping Cart Engine being developed using RoR 2.2.2 using guides from Depot, Agile Web Development 2nd Edition

Video Conversion @ Social.Jobber.MY

The video list

At last, my video engine using Ruby On Rails finally working

1. Upload video + title + body
2. Flow FLV player
3. Acts As State Machine
5. Total Video Conveter CLI running on Linux Centos 5.2

Thursday, February 5, 2009

Video Conversion in Linux using TVCC

Command line conversion in action

The convert section in ruby on rails model

Ok, I hate FFMPEG period.

TVCC ( Search google the term )

1. Download TVCC.exe
2. Install dalam Windows
3. Yum install wine dalam VPS Centos server
4. Kalau takder repo, edit /etc/yum.conf , add DAG punya repo

name=Dag RPM Repository for Red Hat Enterprise Linux

5. yum install wine
6. Installing TVCC, apply PATCH from Mazwan
7. Upload c:\TVCC to /root/TVCC
8. wine /root/TVCC/TVCC.exe -f /root/MOV00022.3GP -o /var/www/ror_projects/soci
9. Ok, cool conversion done. The application works in Linux

The software priced at USD1k ...for full unlimited version..unlimited sites

Wednesday, February 4, 2009

Designer learnt how to build Guestbook using Ruby On Rails in 16 seconds warp speed

Nampak tak InstantRails nyer application, klik I..pastu pilih Rails Apps..pilih Console

Contoh Edit Guestbook

Contoh isi guest book, kalau ada error , terus highlight

Form untuk isi guestbook

Paparan guestbook

The conversation.....

wan azrif: okie
wan azrif: download tu dah settle
wan azrif: so cam mana nak install dulu
Azril Nazli Alias: ok ko install kat c:\instanrails
wan azrif: jap
wan azrif: aku sedang extrack
wan azrif: baru 61 persen
Azril Nazli Alias: ok
wan azrif: okie dah extrack then
Azril Nazli Alias: ok cun
Azril Nazli Alias: skrg masuk folder dia
Azril Nazli Alias: klik ikon I
Azril Nazli Alias: dable klik
wan azrif: then klik okie kan
Azril Nazli Alias: ok
Azril Nazli Alias: ko klik I
Azril Nazli Alias: pilih rails application
Azril Nazli Alias: open ruby console windows
wan azrif: okie dah
wan azrif: then
Azril Nazli Alias: ok skrg ko dalam skrin hitam lagi menakutkan bukan ?
wan azrif: haaa
wan azrif: aku ade nampak path
Azril Nazli Alias: ok taip nih
Azril Nazli Alias: rails guestbook
wan azrif: c:\ balh balh blah
Azril Nazli Alias: pastu enter
wan azrif: dah
wan azrif: wahhh
wan azrif: apa benda berlaku tadi
Azril Nazli Alias: pastu tunggu
wan azrif: tetiba jer keluar
wan azrif: create bebeanyak
Azril Nazli Alias: ok seterusnya
wan azrif: virus kaaa
wan azrif: then
Azril Nazli Alias: guest book ko nak cemana
Azril Nazli Alias: nama,emel,message ?
Azril Nazli Alias: betul
Azril Nazli Alias: guna 3 field
wan azrif: haaa
Azril Nazli Alias: cd guestbook
Azril Nazli Alias: taip tuh
wan azrif: then
wan azrif: sekarang aku dalam folder gustbook
Azril Nazli Alias: cunn
Azril Nazli Alias: ko nak buat 3 field kan
Azril Nazli Alias: so aku citer sikit
wan azrif: okie cam mana tu
Azril Nazli Alias: name adalah string
Azril Nazli Alias: email adalah string
Azril Nazli Alias: dan message adalah text
Azril Nazli Alias: so command dia jeng je jeng
wan azrif: so cam mana aku nak type
wan azrif: aku nak tulis kat mana
wan azrif: hahahah
Azril Nazli Alias: jap aku tgh taip
Azril Nazli Alias: ruby script\generate scaffold Guestbook name:string email:string message:text
Azril Nazli Alias: pastu enter
wan azrif: dah
wan azrif: dia createkan dah
Azril Nazli Alias: ok cuns
Azril Nazli Alias: skrg kita nak run server
wan azrif: huh pendek gilos
Azril Nazli Alias: ruby script\server
Azril Nazli Alias: pastu taip enter
Azril Nazli Alias: opss tekan enter
wan azrif: dah
wan azrif: lepas tu
Azril Nazli Alias: http://localhost:3000
Azril Nazli Alias: kat browser
wan azrif: dah
wan azrif: ooo cam nie rupa dia
Azril Nazli Alias: ok jap aku lupa
Azril Nazli Alias: create database
wan azrif: sama cam kat tutorial lah pulak
Azril Nazli Alias: ko buat arahan nih
Azril Nazli Alias: rake db:create pastu enter
wan azrif: create database kat mana
Azril Nazli Alias: rake db:migrate pastu enter
Azril Nazli Alias: ko tekan ctrl c
Azril Nazli Alias: matikan server balik
wan azrif: perkara tu nak create kat dos tadi ker
Azril Nazli Alias: taip kat dos tadi
wan azrif: k jap
wan azrif: ermm tetiba jer aku tak leh type kat situ lah pulak
Azril Nazli Alias: ok ko dah tekan ctrl + c?
wan azrif: jap
wan azrif: okie dah
wan azrif: then
Azril Nazli Alias: rake db:create
Azril Nazli Alias: kemudian rake db:migrate
Azril Nazli Alias: ok skrg start balik server
wan azrif: apa funtion dia
Azril Nazli Alias: ruby script/server
wan azrif: nak restart
Azril Nazli Alias: taip ruby script\server
wan azrif: dah
wan azrif: then
Azril Nazli Alias: http://localhost:3000/guestbooks
wan azrif: hahahah ade lah siut
wan azrif: biar betul
Azril Nazli Alias: ok sign guestbok ko
wan azrif: udah
wan azrif: beb
wan azrif: siap leh tengok listing lagi tu
wan azrif: tapi
wan azrif: kalau aku biar kan kosong
Azril Nazli Alias: ok ko nak edit
wan azrif: still leh isi lagi tu
Azril Nazli Alias: ok ko nak buat validation ?
Azril Nazli Alias: he heh jap
wan azrif: yela maksud nya
wan azrif: kene isi lah jgn kasi kosong itu jer
wan azrif: basic basic punya dulu
Azril Nazli Alias: ok sat aku test
wan azrif: k
wan azrif: tapi mudah gila beb
wan azrif: kalau aku pro leh siap dalam 1 minti jer tu
wan azrif: ahahahha
Azril Nazli Alias: ok
Azril Nazli Alias: ko bukak file nih
wan azrif: mana
Azril Nazli Alias: c:\instant rails \ rails_apps
Azril Nazli Alias: c:\instant rails \ rails_apps \ guestbook\ap \ model \ guestbook.rb
Azril Nazli Alias: pakai textpad ker
wan azrif: wahh cam mana aku nak bukak tuuu
wan azrif: aku nak tengok kat dos ker
Azril Nazli Alias: pakai textpad laa
Azril Nazli Alias: iskk
wan azrif: WHAT THE FUCK
wan azrif: class Guestbook <> validates_presence_of :name
Azril Nazli Alias: dia akan pastikan user isik name
wan azrif: ler itu jer ker
wan azrif: ko biat betul
wan azrif: so aku save ker
Azril Nazli Alias: kalau nak semua sekali
Azril Nazli Alias: validates_presence_of :name
Azril Nazli Alias: validates_presence_of :email
Azril Nazli Alias: validates_presence_of :message
Azril Nazli Alias: save pastu try isik tanpa tulis nama
wan azrif: okie jap
wan azrif: bapak gudang nya besar
wan azrif: error dia
wan azrif: hahahahahaha
wan azrif: 1 error prohibited this guestbook from being saved

There were problems with the following fields:

* Email can't be blank
wan azrif: huh itu jer code dia yek simple gila lah bro
Azril Nazli Alias: he heh
Azril Nazli Alias: nak ubah ko godek views/guestbooks/
wan azrif: ooo tak salah aku
Azril Nazli Alias: dalam layouts file master dia
wan azrif: dalam folder dia nie
wan azrif: sama macam warisan lah pulak
Azril Nazli Alias: views/layouts/
Azril Nazli Alias:
wan azrif: ade app folder
wan azrif: hahahaaha
wan azrif:
Azril Nazli Alias: warisan..e-rakan
wan azrif: maknanya ko guna ruby lah nie yek
wan azrif: oooo ic
wan azrif: cam tu senang lah aku nak godek
wan azrif: sebab aku dah tau
Azril Nazli Alias: tak..aku guna cakephp
wan azrif: hahahahaahh
Azril Nazli Alias: yg aku ajar kko nih guna ruby
Azril Nazli Alias: super ultra easy
Azril Nazli Alias: ok aku nak ajar ko guestbook guna database pulak
Azril Nazli Alias: jom start balik
Azril Nazli Alias: database mysql
Azril Nazli Alias: k kata nak buat contact form kan ?
wan azrif: oooo
wan azrif: satu satu lah
wan azrif: sebab aku nak try buat balik
Azril Nazli Alias: ok ko layan laa dulu guest book
wan azrif: haaaa
wan azrif: dah ler aku baru nak berjinak
Azril Nazli Alias: ko try ubah layout
Azril Nazli Alias: ubah file view dia
Azril Nazli Alias: ko tengok fail view dia
Azril Nazli Alias: ada 4 keping
wan azrif: okie
wan azrif: aku nak tanya ko nie
wan azrif: kenapa
wan azrif: name : string
wan azrif: dan message : text lak
Azril Nazli Alias: sebab nama kan pendek
Azril Nazli Alias: kalau ko set text..boleh jadi panjang
Azril Nazli Alias: dan automatik dia set textarea
wan azrif: kalau nama dia cam nama aku wan ariffuddin bin wan ramli
Azril Nazli Alias: tetap string
wan azrif: okieee
Azril Nazli Alias: text nih macma nak isi karangan
wan azrif: okie kalau aku nak letak yg melibatkan number
Azril Nazli Alias: phone:integer
wan azrif: contoh phone:number cam tu ker
wan azrif: ohh interger
Azril Nazli Alias: age:number
wan azrif: ceh cam c++ lah pulak
Azril Nazli Alias: umur:integer
Azril Nazli Alias: bukan number
wan azrif: okie okie aku nak tau benda benda tu dulu
Azril Nazli Alias: age:integer
wan azrif: so baru rancak nak buat testing nanti
Azril Nazli Alias:
wan azrif: so kalau tarikhate lah yek
wan azrif: tarikh : date lah kan
Azril Nazli Alias: yup
Azril Nazli Alias: tarikhate
Azril Nazli Alias: dem
Azril Nazli Alias: kahwin ker belum ? status:boolean