elfs: (Default)
[personal profile] elfs

I have a contract that I’m working on that requires I work with rails.  That, in itself, isn’t so bad.  But I think what bothers me most about rails can be summed up in one word: partials. For example, let’s say I have the following:

render :partial => 'employee', :collection => @employees

What this means is that the files _employee.rhtml, using the internal variable employee, will iterate multiple times over the collection employees. The “magic” here is that the internal variable and the partial name coincide. This is called, in rails, using convention over configuration.  And while it makes perfect sense, it is in some sense straitjacketing.  Yes, I know, people will tell me that the internal variable name can be changed with the :as symbol; that’s not the point.  Ruby is such a malleable language that rails almost seems anathemic to ruby in the first place: why use what is just about the most flexible language in the first place, and then create a set of conventions which must be memorized in order to make the thing go?

I kinda like ruby and rails, but they don’t seem to belong to one another.   It feels very much like a marriage with a mail-order bride.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 2nd, 2025 08:27 am
Powered by Dreamwidth Studios