development

Rails Tricks

Do you know what the command below would do?

post.select(&:activated?).collect(&:title)


Do you want to get maximums, minimums, averages, or sums for data in your tables? Did you know ActiveRecord has a .to_xml() method?

Ruby Gem Update - RemoteSourceException

If you need to update any gem in your system and you get some strange error message like the one below, maybe all you need to do is upgrade your RubyGems component.

ERROR:  While executing gem ... (Gem::RemoteSourceException)
              HTTP Response 403


I got the above error message when running the following command:

gem update --system


Another symptom that you need to upgrade your RubyGem is if you notice that the system responds different versions for your components:.
For instance, if you get this...

  

Firefox Add-on Collections

The Firefox website now allows you to create a Collection (in a very slow site) of your favorite add-ons either to save for later reinstalling or sharing with everyone else. So I created two Collections (so far):

Call link_to_remote from inside the Controller in Rails

I wrote an article the other day stating that I had no idea why someone would call a Helper method from inside a Controller in Rails.
I just found a reason. Here is what I needed to do:

HOW-TO Call a Helper Method inside the Controller in Rails

Rails relies on the MVC separation to do its job, i.e. the Model handles the database interaction, the View handles the user and front-end interaction and the Controller handles the business logic and flow of the information.

Change Netbeans 6 IDE Language

I downloaded and installed today the Netbeans 6.7 and for my surprise its IDE was in Portuguese. I prefer using the IDE in English, so I tried to change it using the way I remembered from previous versions, i.e. at the Tools menu. As it happens, it is not possible to change the language of the IDE through the interface, because it is based on the locale of your machine.

10+ Deploys Per Day: Dev and Ops Cooperation at Flickr

This is an interesting presentation by the Flickr team on how (actually more the "why" than the "how") to achieve the best integration of developers and system operators. Simply put, "the team's job is to enable business".

Syndicate content