18 Oct '12, 9pm

An eCommerce Refactor: Cleaning up a Common Pattern in a Rails eCommerce App

“We can’t add any more features”, I said to Cillian. We had reached that point when building a web app using Rails that if we added another line to that controller, I couldn’t help but feel the whole thing would come crashing down, like placing the last block in a game of Jenga. “We need to refactor.” The code in question was extremely common code: handling customer payments. Like many, many eCommerce setups out there, we wanted to be able to accept payment by PayPal, or by credit card. Since we also wanted to support multiple stores, we wanted to accept multiple payment gateways. The purchase controller logic looked a bit like this: class PurchasesController def create @purchase = Purchase.new( params[ :purchase] ) if @purchase.free? if @purchase.confirm redirect_to @purchase else render :new end else if @purchase.paypal? redirect_to_paypal elsif @purchase.credit_card? if...

Full article: http://www.engineyard.com/blog/2012/ecommerce-rails/?eymk...

Tweets

A refactoring story with a happy ending: "An eC...

engineyard.com 18 Oct '12, 9pm

“We can’t add any more features”, I said to Cillian. We had reached that point when building a web app using Rails that if...

Data Science at Engine Yard

engineyard.com 25 Oct '12, 8pm

There’s nothing glamorous about it. You are not a rockstar, but a janitor. You will clean a lot of data. A LOT. Most peopl...

e-Commerce Custom CMS - Ruby on Rails by Adrena...

freelancer.com 30 Oct '12, 5pm

Freelancer.com (formerly GetAFreelancer) is the world's largest outsourcing and crowdsourcing marketplace for small busine...

Reality of Data Science

engineyard.com 25 Oct '12, 7pm

There’s nothing glamorous about it. You are not a rockstar, but a janitor. You will clean a lot of data. A LOT. Most peopl...

"Love this article. I am a big evangelist of us...

searchengineland.com 14 Oct '12, 3am

Which video recipe will make your cash register ring more often and more loudly? It was the end of a 12-hour video shoot. ...

Announcing Engine Yard Buffalo

engineyard.com 24 Oct '12, 6pm

Engine Yard is excited to announce the opening of its office in Buffalo, NY on October 1, 2012! The Buffalo space is our p...

SMB News: Is Your Ecommerce Site Ready to Captu...

networksolutions.com 15 Oct '12, 12pm

While the effect of social media and mobile devices on consumers’ holiday shopping habits is making news this year, Citi’s...

e-Commerce quiz (beginner level): What's wrong with this web page?

e-Commerce quiz (beginner level): What's wrong ...

mrcoffee.com 24 Oct '12, 1pm

Recommend Product: 12-Cup, Black, Replacement Decanter Model: PLD12-2 close X Your message to your friend will read: I tho...

Is your #eCommerce site ready for holiday shopp...

networksolutions.com 23 Oct '12, 8pm

Test your site. Make sure the nuts and bolts are working and that load speeds are up to par. Help ‘em out. Can consumers q...

An Illustrated Guide To E-Commerce Markup Using...

searchengineland.com 15 Oct '12, 7am

We welcome constructive comments and allow any that meet our common sense criteria. This means being respectful and polite...