Practise as tutorial on this book https://www.railstutorial.org/book/beginning#cha-beginning