After working with Ruby on Rails for a few years and spending the past 2 months knee deep in it for 8-10 hours a day, I’ve learned a few things about working in Ruby on Rails. I owe my basic understanding to Jonathan and Sean from when I was working with them on Voomaxer.
The Tips
1. Work with smart programmers who are also good teachers
The lead developer at Bleacher Report is both a great developer and a great teacher. This is the single most important thing for making working with Rails (or any language) easy. Whenever I have a problem (which is regularly) I say “Hey Tung, how do I ________?” The other engineers are equally helpful and very smart.
If you don’t have access to smart coworkers, try talking with developers regularly on IRC or in forums. Many of them are very willing to help out if you are genuinely curious and don’t ask basic questions that you’d find quickly using Google.
If people can’t explain something so that you can understand it, chances are they don’t really know what they’re talking about. Experts are good at explaining things to non-experts.
2. Stay organized
A brand new Rails project is setup to keep the developers organized. The MVC pattern is great for keeping programmers from putting too much logic in a view or writing a bunch of SQL alongside a bunch of logic. It is not so good at keeping designers organized.
Namespace your images using folders. If I have a button that goes on the sign up form, I put it in a directory that looks like this:
/public/images/forms/signup/signup.jpg
But more often than not I use sprites, which I would keep in /sprites/buttons.jpg.
I do the same thing for stylesheets. As an example there is certain CSS that is loaded on every single page of the site (i.e. the header). I would keep that in it’s own file:
/public/stylesheets/common/header.css
Under the /common/ you would include all of the CSS files that are loaded on every page of the site, my stylesheets directory looks like this:
/public/stylesheets/common/reset.css /public/stylesheets/common/base.css /public/stylesheets/common/grid.css /public/stylesheets/common/header.css /public/stylesheets/common/sidebar.css /public/stylesheets/articles/article.css /public/stylesheets/articles/comments.css /public/stylesheets/widgets/widget_1.css /public/stylesheets/widgets/widget_2.css ...
Wait! Don’t you have to write 20 different links to external CSS stylesheets in the header if you do this? No. You use asset packaging, which takes all these stylesheets, removes the white space, and turns them into one stylesheet that loads nice and fast.
<%= stylesheets_link_merged :base %>
If your development team is not using asset packager, suggest it to them - there are many benefits beyond organizing your CSS. Also, I know that you are probably thinking this organization is a bit anal retentive and causes more pain in the long run, but if you’re working on a site of moderate size it’s just as annoying to scroll through 7,000 lines of CSS.
3. <%= and <% are different.
This is insanely obvious to every engineer. To me, this was not obvious. It turns out code that looks like this:
<%= %>
Actually spits something out onto the page. You wrap your Rails link helpers with <%= because it will actually spit out the results into the HTML. If the code begins with:
<% %>
Then it does not actually output anything that the user or browser can see but is parsed by Rails - if/else statements, loops, etc. will go in these tags.
4. Break things regularly
A lot of what I’ve learned comes from when I try to do something on my own without asking a developer. It usually breaks. I usually then have to reverse engineer what I broke and figure out how to fix it. Guess what? After I do this I understand why it broke and why the code was written a certain way.
This is a great way to learn any programming language. Actually, since starting work, this is how I’ve learned most of what I know about our Prototype. I will probably use the same method to learn more about Ruby and Rails. Just remember not to check in broken code - version control will identify you as the culprit.
The Hype
There was (and is) a lot of hype around Ruby on Rails. (Did you know 37signals uses it for Basecamp?!) You can read millions of blog posts about it and buy all sorts of books with advanced Rails recipes. People argue until they’re blue in the face about whether Ruby is faster than this or Rails is faster than that.
Guess what? When you’re working on a team that just wants to push a kickass product out the door, no one thinks about these things. People code in whatever language makes them happy and seems like the best tool to get the job done. The people building real, useful products in Ruby often don’t have the time to hang out on message boards arguing about millisecond differences in response time.
The truth is, Ruby on Rails is good enough for most web apps. Tung (our lead developer) answered the question “Does Ruby on Rails scale?” with another question: “How good is your code?” I think he heard that somewhere else, but I don’t know (or care) where.
{ 12 comments… read them below or add one }
I’m not a designer, but I like what you said here. Being organized is the most important part of any software development project, be it as a designer or developer. If you start organized and stay organized, then you’ll be ok. If you start off wrong, then all hell can break lose down the line.
I think the only place you may be off is with the statement that “Experts are good at explaining things to non-experts.” There are some things that are just too obtuse to be explained quickly and easily to people who don’t have intermediate to advanced knowledge of a subject. To be fair, these aren’t things that a designer would usually be involved with so maybe you weren’t addressing them ;)
I’d venture to say that not just “good enough”, but rather great for most web apps. For the vast majority of people out there, their apps will never require intricate scaling, and all frameworks have issues scaling anyway. It’s the instant gratification of Rails that is so great, and it really speeds up development time, so that, even if you do end up running into scaling issues, the time you saved upfront is well worth it.
I tend to disagree - even advanced theoretical physics can be explained in terms that most people understand. Do you need to understand some basic physics principles? Sure. But nothing you didn’t learn in high school physics classes.
Good explanations are not necessarily succinct - it may take a day to explain something very advanced, but that doesn’t make it a bad explanation.
I guess the only concern is if you lose something in the translation to simpler terms. I surmise that string theory can be abstracted to the point where you don’t have to be actively studying high-level physics, but I would guess that some of the more nuanced concepts would be missing after the translation.
Then there are the things that are pure mathematical constructs that humans have come up with to better understand the world. How do you explain these to a non-expert with no direct knowledge of the subject? I guess the two things I can think of from my domain are continuations and closures. You almost have to learn a little bit of lambda calculus to know what is going on. Once you start doing that, you’re becoming a domain expert via the explanation, so you’re actually learning the subject yourself and becoming a pseudo expert (even if it is just a particular niche of a topic). You make a good point that good explanations aren’t necessarily succinct, but where do you draw the line between an explanation and a lesson?
Of course what it really boils down to is this: In day to day life, you don’t really need to know the things that can’t be abstracted and explained in simpler terms.
Agreed, Kyle.
That leads us to the second point I want to elucidate. ,
scary pop up mazes
tiffany patterson naked
xem phim free
coco austin pictures
karrine superhead steffans
magic mouthwash prescription
nicole catsouras gory crash photos
nitto 1320 cheats apocalypse
www provocraft com
toll accident nicole catsouras
stacy johnson klein photos
wagner paint sprayers reviews
carson pierie scot
line rider mod
dirty truth or dare
candice millard author
craigslist inland empire
girls bent over
free world of warcraft stat changer
tamagotchi hacks v4 5
club penguin super money cheats
stickrpg complete hack download
detroit tigers layouts
default div overlay layouts
fotos de la burbu desnuda
mapsco driving directions
nicky porsche crash pictures
74 gangster disciple knowledge
mjr theatre michigan
myspace layouts hunting camo
automatic skeet thrower
free runescape stuff
pictures of london charles aka deelishis
www nickelodian com
printable christmas puzzle worksheets
porsche girl photos nikki
lady justice butler sloss
nicole porsche wreck
espin the bottle com
flavor of love nibblez website
famous retirement toast
kiko bailando duranguense
stick arena demo trainer
piernas de penelope menchaca
2010 fall short hairstyles
mayrin villanueva porn videos
barbara mori playboy fotos
chicas chocha linda
odalys garcia piernas
ber chinas mexicanas cojiendo
diseños tarjetas para 15
las mejores fotos de claudia molina
univision com novelas por interne
el heraldo de chihuahua clasificado empleos
start david myspace layouts
belk online employment applications
abecedario de letras goticas
pictures of steve harveys house
natalia villaveces video
fotos de mariana seoane
mugen characters family guy
honbres cojiendo mujeres
mugen download char dark sonic
upskirt de barbara mori
coi phim chuong hong kong
nhung truyen nguyen ngoc ngan
any science investigatory project
dust mite bite photos
mexicanas panochas peludas
gucci man brought up on murder charges
hell ryu mugen free download
potrero night club cudahy
starwood 401k
mujeres chupando pollas negra
video de sexo gratis viejas ricas
best biscuit recipe for chicken dumpling
yahoo att login
niurka marcos topless
lisa left eye lopez autopsy video
deelishis xxx pictures
claudia casabianca desnuda
gangsta l letter
condolences paragraph
american curves lingerie
jeans by delicious
jenny rivera daughter
videos de incestos niños con las mamas
demonstration speech rubric
panocha foto
stacked bob haircut pictures
las mejores puerto rikas fotos culiando
mariana torres desnudas
mosquito bite infection picture
jesse combs nude
fotos de panochas gratis
real chicas virgenes con pollas grandes
dada ne choda
buy 4 wheelers with no engines
tifa mugen char
altas pendejas fotolog facebook
sasha cohen is jewish
confederate layouts for myspace
el triangulo de las bermudas
tom joyner huggie low down
pinoytube tv video scandal
mexican consulate in houston tx
jenna jamison bob haircut
poway unified school district
reverse blue brindle pit bull breeder
pictures short haircuts bobs angels
testicular cancer symptons
amor en custodia tv
mossberg 935 parts diagram
arac free sex vedio clip
uptown comedy club schedule atlanta ga
ed hill upskirt
catsouras nikki crime scene photos
destiny s child cater to you
hearts grow yura lyrics
summary of tears a tiger