Furio's Fury

RubyConf Argentina 2011

(This is not really a news, but something I really want to talk about)

The Ruby Argentina group is organizing the first RubyConf, here in Buenos Aires.

RubyConf Argentina 2011 is a two-day event coming to Buenos Aires the 8th and 9th of November, focused on Ruby and modern web technologies related to the Ruby programming language.

The program is designed to cover the interests of a wide spectrum of programmers, from the new developer who is interested in learning Ruby for the first time to the long-time Ruby expert. The event is designed to open a dialogue between developers in Argentina and the rest of the world.

We have a big list of remarkable speakers, from Argentina and the world!

I hope to see in November a big group of Ruby programmers. If you are interested on coming, please, fill registration form at Eventioz or visit the RubyConf Argentina website to make up your mind.

Podcasts

Clearly, there are lots of sources of information on the web. Blogs, News feeds, Twitter, forums, podcasts, screencasts, etc.

With work, family, friends, and other related stuff, I don’t have much time to exhaust all of them, so I have to choose. Since I ride a bike pretty much all the time, my favorite way of learning is by listening to some podcasts and by watching screencats.

Free

Paid

  • Destroy all software from Gary Bernhardt. This like getting advice from a pro. Gary is super smart and talks about many topics. Ruby is one of them, but Python, VIM, and others are mentioned.
  • Peepcode from Geoffrey Grosenbach. Do I really have to explain what peepcode is? Go, boy, get yourself an unlimited subscription right now.

Change Is Beautiful

Time to change things. This blog, for instance. But I’m not gonna reinvent the wheele. Let’s use Octopress and see how it goes. Seems like what I need right now: A good way to blog about nice things I’m learning about Ruby and Javascript, things I’m passionate about.

But wait a minute! Are you gonna blog in English? Don’t know. Seems like that, so we’ll see.

Acts as Rubylit 2010 - Gracias

Este fin de semana pasado se realizó la Acts As Rubylit 2010 en la provincia de Santa Fe, Argentina.

Fueron dos días de charlas muy interesantes, de compartir un montón de anécdotas con otros compañeros rubistas y de mucho más.

A pesar del viaje (que no me copaba mucho) debo decir que la pasé más que bien gracias a la hospitalidad y el buen trato de los organizadores. Se notó el esfuerzo que hicieron, y es importante que sepan que se aprecia y agradece mucho.

Hacen falta más eventos como estos (no hace falta decirlo, verdad?). Quizás con esta nueva lista podamos darle el nuevo empujón que anda necesitando.

Fue un placer asistir, hablar (a pesar del julepe considerable que tenía) y conocer a cada uno de los participantes.

Hasta el año que viene, muchachos.

Adding Custom Input Fields to Simple Form

In a project I am using Simple Form from the guys of PlataformaTec as a Form Builder. At the beginning of the project, I decided to switch from formtastic to this one because I am big fan of what José Valim is doing. I really like his code, and I think that what he writes is always (as far as I know) extendible, usable, and of course, simple to use.

So last week I needed to use a particular kind of input field. We needed to show a box like this one:

subdomain

Pretty self explanatory, right?

I wanted to be able to write something like this in my view files (in HAML)

1
2
3
= simple_form_for :organization do |f|
  # ...
  =f.input :subdomain, :as => :subdomain, :domain => 'foooo.com'

So in order to achieve this, we only needed to add this to config/initializers/simple_form_extensions.rb (for example).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module SimpleForm
  module Inputs
    class SubdomainInput < Base
      def input
        "\#{protocol}\#{@builder.text_field(attribute_name, input_html_options)}.\#{domain}"
      end
      def domain
        input_options[:domain]
      end
      def protocol
        input_options[:protocol] || "http://"
      end
    end
  end
end

The key part here is to name the class properly, so when you do :as => :my_class, your MyClass gets called automatically.

Simple Form is very well structured, and provides lots of ways to customize its functionality. Check the readme file to see what you can do without having to create a custom input class like SubdomainInput. Also, you can check this week’s railscasts.

Themes for Rails

Ha pasado un buen tiempo desde mi último post. Soy uno más de los que abandona su blog cuando anda con muchas cosas, evidentemente.

Para un laburo que estoy haciendo ahora (que espero no tardar en presentar) estaba necesitando soporte para themes. Miré un poco por ahí, y di con themes_support. Lamentablemente no tenía soporte para Rails 3. Mirando un poco más me di cuenta de que estaba implementado usando técnicas de monkey patching (not a big fan) y que ya no le estaban dando mucha bola. Contacté al mantainer y lo consulté respecto al mantenimiento, y sobre una nueva versión para Rails3. Me dijo que no tenía tiempo.

Dado que realmente necesitaba algo para brindar dicha funcionalidad, decidí escribirla de cero, por mi cuenta. Esta nueva versión se “engancha” elegantemente de Rails 3, y ha sido testeada “bastante”. Debo confezar que por primera vez usé TestUnit (antes era 100% rspec). Estuvo bueno.

El código se encuentra aquí: ThemesForRails

Compatibilidad, Instalación y el resto de la fruta:

Para simplificar, se usa exactamente igual que el theme_support, aunque su instalación es a través de rubygems. Requiere Rails 3, obviamente. El readme cuenta con un montón de información.

En fin, espero que a alguien le pueda servir tanto como a mi.

Salud, Rubyistas. Nos vemos en Uruguay, no?