Rails: url vs path

September 21st, 2009 Petros No comments

I was wondering why some people are using _path and why some use _url. For example, if you have a Post resource you can write the following in your view:

<%= link_to 'List of posts', posts_path %>

or the following in the controller:

redirect_to posts_url

Why should I use _url in the controller. I have used _path and it seems to work.

This is an explanation I found in a forum and I quote:

*_path are for views because ahrefs are implicitly linked to the current URL. So it’d be a waste of bytes to repeat it over and over. In the controller, though, *_url is needed for redirect_to because the HTTP specification mandates that the Location: header in 3xx redirects is a complete URL.

Categories: tips Tags: , , ,

Volunteering

September 1st, 2009 Petros No comments

Volunteering to non-profit organizations or to open source software projects is my second deed (2-deed).

I started this activity in June 2009 by becoming a member of Builders, a RailsBridge project, that connects volunteers with projects for 501c3 non-profits.

So far, I am volunteering in two projects: 1) Sunset PTA and GlamourGals Foundation.

The basic reasons I do this are:

  • Learn
  • Network
  • Give back

I learn asking questions or watching other team members doing stuff I don’t know. I discovered this way of learning is much faster than just reading and online searching. It cannot replace these of course, but it can help in addition to these methods of learning. Sometimes, when I learn something new from a fellow team member, I feel that it would be very difficult to discover it by myself.

When you volunteer to various projects, it is very easy to meet people with more or less the same mentality as yours. You get the opportunity to know them, open up your mind to new ways of thinking, choose who you like better and maybe create stronger relationships that may lead to other forms of cooperation in the future. This is extremely difficult to accomplish if one is only dedicated to their daily business because they don’t have many opportunities to network with new people.

Years and years, I have been receiving a lot of help from the Internet community in various forms: Forums, using free open source projects, becoming better by participating to various communities, educating myself, watching the improvement of commercial products because of the pressure of open source equivalent products, and more. I give back to the community by actively contributing and this makes me feel good. It also helps sustain the community and continue growing it.

This is going to be my second deed and I’ll keep posting any news that fall under this category.

A typical workflow for a team using Git

August 27th, 2009 Petros 2 comments

Lets assume you are in a team, working on a Rails project and you have chosen Git as your version control system. One way to complete a working cycle from pull to push is:

DISCLAIMER: There are more ways and many situations that are not described here. This is only a note to self that may also be useful to you.

Read more…

Categories: tips Tags: , , ,

Git log

August 25th, 2009 Petros No comments

When I am working with git, I find it useful to take a quick look at the log. The default

$ git log

command doesn’t show the actual modified/added/deleted files. You can use the following command for that:

$ git log --pretty --stat

or

$ git log --pretty=format:"[%h] %ae, %ar: %s" --stat

I found the latter in one of Alex Young’s tweets.

If you have any favorite git log formats, please feel free to mention them in a comment.

Categories: tips Tags: , ,

Installing RSpec and Cucumber

July 11th, 2009 Petros No comments

Open your shell and,

For RSpec:

$ gem install rspec

For Cucumber:

$ gem install cucumber

Optionally, if you are on Windows, for color output you can also install Win32Console:

$ gem install win32console
Categories: tips Tags: , , , ,

Highrise SMS notifications

July 5th, 2009 Petros No comments

I really love Highrise. It is a 37signals service that helps you organise your contacts, your conversations with these contacts, cases, deals and tasks. Highrise also sends task notifications using SMS. Unfortunately it only supports specific providers for certain countries only. My country (Greece) as well as many other countries all over the world are not included in that list. Nevertheless, I managed to make Highrise send notifications to my mobile phone through Google Calendar.

Read more…

Using Jing while working remotely

June 24th, 2009 Petros No comments

One of the tools I really appreciate because it helps me enhance my communication is Jing. Jing has a free edition that supports both screen captures with annotations and video captures with voice!

Read more…

How to avoid alienation while working remotely

June 23rd, 2009 Petros 2 comments

In my previous post, I mention that we started working remotely in order to improve our productivity. I chose “remote work” because I believe it solves some issues. Most of the times, however, when you try to solve a bunch of problems, you may create a bunch of new ones. In the end you may not gain anything despite the effort.

Read more…

Working remotely

June 22nd, 2009 Petros 4 comments

It all started 6 months ago. I was pressed by management to improve our team’s productivity. We are a team of 4 programmers with me as a leader. I identified some factors that in my opinion influenced our productivity and I reckoned working remotely could eliminate them. As a result we could increase our productivity.

Read more…

Categories: remote-work Tags: ,

Video on Usability by Adam Dunford and Jason Edwards

June 18th, 2009 Petros No comments

Categories: ui Tags: , , , ,