Category Archives: RubyonRails

Routes in Rails

A couple of posts back I created my nav menu by linking to other pages in my site using the link_to method.  I then moved the whole chunk of code into a partial and used the render method to show it in the main view. I now want my url structure to look a little neater,… Read More »

Adding a partial in Rails

Sometimes you just need to repeat the same code across the site and whilst it’s great to have it in the application.html.erb file it can make it look a little messy… that’s where partials come in. A partial is basically a part of your code you want to reuse and here’s how to do it.… Read More »

Undo generate in Rails

There’s a simple way to undo things in Rails using the ‘destroy’ command. Lets say you created some static pages using the following command: $ rails g controller StaticPagges home about help You’ve mis-typed StaticPages so time to get rid. $ rail destroy controller StaticPagges home about help Same for model or view $ rail… Read More »

Add git repo to local folder on Mac OS X

I have loads of space on the Box platform and wanted to keep my work on there instead of paying for private repositories on github.  Yeah bitbucket is free and private as default however there’s a limit to the number you can have.  With I have 50Gb of space which should be enough for… Read More »

Rails – Intro

I’ve been toying with a fair few languages and whilst I can knock up a decent iPhone App I never really focused on web dev.  I remember building out my first site and was amazed when my first <div> and <p> took shape. A lot has happened since then and I have a fair few… Read More »