Posts from the "Ruby on Rails" category:

Rails Girls

May 24, 2014 / category: Ruby on Rails / 1 comment

Because of being invited to take part in a Rails Girls event, I created two presentations. Both of them are intended to be used as short introductions (to Ruby and Git, respectively).

Take a look if you'd like to use them to train other beginners, possibly at an another Rails Girls event.

Generate Sitemap in Rails

December 09, 2008 / category: Ruby on Rails / 6 comments

If you don't know what is a sitemap, I strongly encourage you to fill this gap in knowledge first and then get back to reading.

It seems to be clear that manual updating a sitemap can turn into a horror. Hopefully we can make the Rails do the job for us. We are going to need a separate action, an XML view and model methods to provide us with URL data. You can read here how to put all these things together.

HTTP Basic Authentication in Rails

November 29, 2008 / category: Ruby on Rails / 2 comments

Sometimes we want part of the website to be available to specific users only. Either we don't want our users to interact with a piece of functionality we are still working on or we want to show the new function to our client first, before making it available to the public. In both cases, we can't let a single unwanted user to slip through our fingers.

HTTP basic authentication is the most simple way to achieve this and we're going to show how it can be used in Rails. It's really simple!

SQL HAVING Clause in Rails ActiveRecord

November 12, 2008 / category: Ruby on Rails / 0 comments

Rails ActiveRecord is a quite useful piece of software, though it lacks some features and way of achieving the desired result is not always obvious.

Let's assume that we have two tables in our database: categories and posts. We would like to get most essential categories; i.e. those having at least 10 posts assigned to them. We can achieve this using the SQL JOIN, GROUP BY and HAVING clauses. However, there is no :having parameter on the find() method's parameter list.

Let's take a look at a simple workaround.

My eBook: “Memoirs of a Software Team Leader”