A couple of weeks ago, Aaron Osteraas asked me to write some stuff for the Ruby Source website. I’ve written a couple of posts over the last week and the first one was published today! It’s called 7 Things I Love About Sinatra, I hope you’ll pop over, have a read and maybe leave a comment.Continue reading »
Hi everybody. Sorry for the inactivity recently - I haven’t had chance to use Sinatra much at all, but that should change over the summer, happy days!
Here’s a quick piece of code that can often prove to be useful. When you’re producing websites or apps, you often need to know if a link is pointing to the current page or not. The main use for this is in a navigation menu - the current page is often styled differently. You can see a nice example of this on Google’s new homepage - the black nav bar at the top has some links, but the current page has an orange border on top.Continue reading »
I’ve just finished my first full Sinatra project to go live and thought I’d share it with my fellow Crooners.
Cards in the Cloud is a web app that lets you send e-cards without all the usual fluff associated with those kind of sites (like tacky music, annoying animations and loads of intrusive adverts). I decided to build the site to scratch my own itch because I could never find a site that would just let me send cards without trying to spam me or get me to sign up for something.Continue reading »
Sinatra 1.2 was released a few weeks ago and you can see the full list of all the shiny new additions here.
SlimContinue reading »
Rails has a nice little hash called the Flash - it’s not a Super Hero that can run fast, just a neat way temporarily storing messages to inbetween requests. For example if something happens in your app (a note is saved for example) and then you redirect the user to another page then you could store a message in the flash saying that the note had been saved. This message would then be shown on the next page (after the redirect).Continue reading »
One of the biggest requests from people is a post about authentication. There are loads of gems that help to do this, but I like to roll my own. Here’s a really simple way of creating an admin section of a website.Continue reading »
Please note that there are some problems with the code in this example - particularly the part about uploading a file to Heroku. You might still get something out of the post (and there are a lot of helpful comments) but please bear in mind that it might not work exactly how it should. I plan to write an updated guide soon that will hopefully work much betterContinue reading »
Happy New Year!
It was a year ago that I started this site as a New Year’s Resolution and I’ve had a brilliant time.
I didn’t quite manage to produce a project every couple of months like I originally intended, but I did learn A LOT about Sinatra and loved every minute of it. I’m more convinced than ever Sinatra is the best tool for web development. Over the last year I’ve learnt about lots of new things and managed to blog about them as much as possible, but I’m disappointed that I haven’t been able to produce more full tutorials and will try to do more over the next year.Continue reading »