« back

Getting Started With Sinatra

30 Aug 2012

Today I got started on my second version of a web based Tic-Tac-Toe(TTT). The first one was put together in Rails and this one will be made using Sinatra.

I have very little Sinatra experience and am really looking forward to this iteration of TTT. I am predicting that using Sinatra will help me demystify some of the magic of rails.

I first decided to head over to the Sinatra documentation. It was clear pretty quickly that this was not what I needed. I really needed some kind of a tutorial. After doing a search and sizing some of the tutorials up, I decided that basic was probably the best for me at this point. I went with this one. It turns out that this is a 3 part tutorial that will involve a database connection which is what I will need to implement so I am glad that I will have guide.

After walking through the first part, I wondered, 'But where are the tests.' I ended up finding this tutorial on the same site which is about using rspec with Sinatra. Great.

Taking a cue from the first tutorial on how to get a form up and running, I made one that contains drop-down menus to allow human or computer selection and text fields that allow player marker selection. I was able capture the params and display them as a proof of concept. DATABASE TIME!!!!!!!!! :)

As I looked through part two of the tutorial, I realized that I would want to do some deeper digging on Data Mapper. Although some of the "whirlwind tour of DataMapper" is useful, I will need some more info on database connections and how the resources work.

The day goes by too quickly. So far, I am really enjoying Sinatra. I like that so far, the only code I have to have in my app is what I need. It really does feel light weight.

comments powered by Disqus