Newsflash: Rails isn’t bad.

Rails is *not* as insanely backwards as I’d previously thought. In fact, I think that *I* was the insanely backwards one. It’s tough to wrap your brain around new paradigms, though.
Before today, I’d seriously begun to chalk Rails up as A Pain In My Ass that I’d probably never find a real-life use for. Research into the matter unearthed that there’s quite a lot of people out there that think of Rails the same way.
Well, I’m here to tell you: it’s not true. Mostly. It’s still something of a pain, it sometimes does its own thing, and the real-life utility is still to be determined. But I’m really, really, really close to making it work for me. Today I had several revelations:
1. You do *not* in fact have to have a separate controller for each page of your site. This question had been rattling around in my head for months, and apparently every programmer on the planet has his/her own way of answering it. This is probably because there’s no wrong answer… I had a site working pretty smoothly with like, a hundred controllers (that’s an exaggeration) and thousands of views (that’s another exaggeration.) I’ve whittled the same site down to 3 (or 4?) controllers, and some massive number of views. Which brings me to my next revelation…
2. Partial views are your friend. Partial templates are like carburetors… insane mojo that makes no sense in documentation, but once you ‘get it’, it’s really a pretty simple mechanism that makes a *lot* of sense. Great, huh? Oh, but somewhere in between there, I started having all these issues because styles and images were simply not working. Onward, to revelation number…
3. Use Rails. Dump HTML. At least wherever possible. It’s incredible what a huge difference it makes once you start really using the Rails metacode all over the place. Things start to work. Styles start to appear. Images… yes, *images* start to show up on your site. It’s amazing, I know. I’d been using standard HTML (well, XHTML anyway) to display all this great stuff, and as soon as I pushed it into the fewer-controllers-and-more-views method, all hell broke loose. Using Rails metacode made things better.
It kind of sucks that I don’t know anyone who knows Rails, and frankly I’ve determined that the Rails community (so far as I’ve been exposed to it) is clicky as hell and very, very snooty, so they’re useless to me as far as asking questions. The documentation leaves a *lot* to be desired, although now that I’ve gotten used to scrolling all over the place and using command-f to find what I need, more or less, the Rails API has finally become *slightly* useful. I have so many questions that need answering… and while I know programmers who know theory like the back of their hand (and it helps, believe me!), it’s nice sometimes to just get an answer. If I’d known these few things months ago, I’d be in a far different place today.
As it stands, I’m not unhappy at all. Rails is suddenly awesome, fast, and everything that people have been spouting off about. I’ve got more to learn, no doubt about it, but these steps have been huge for me. Hooray.

This site uses Akismet to reduce spam. Learn how your comment data is processed.