Close and Go BackBack to Viget

Ruby on Rails

Stubbing Method Chains with Mocha

Ryan Foster
Ryan Foster, Web Developer, August 30, 2011

Yesterday, I came across a head scratcher trying to stub my tests with Mocha. I checked the documentation. No luck. I tried a few Google searches. Nothing obvious. The next logical step: ask around the development team. Their savvy didn't disappoint. Here's the breakdown on how to stub method chains using Mocha.

Continue reading "Stubbing Method Chains with Mocha"

Authentication in RailsAdmin with SimplestAuth

Tony Pitale
Tony Pitale, Former Staffer, July 06, 2011

See how I added administration and authentication to Opower's new website using RailsAdmin and SimplestAuth, all before lunch.

Continue reading "Authentication in RailsAdmin with SimplestAuth"

Rails Admin Interface Generators

David Eisinger
David Eisinger, Senior Developer, May 31, 2011

Here at Viget, we’re always looking for ways to reduce duplicated effort, and one component that nearly every single one of our applications needs is an admin interface. As such, we’ve spent a lot of time trying to find the perfect drop-in admin interface generator. We’ve been happy with Typus for the past year or two and have been able to contribute back to the project on a number of occasions. Lately, though, a pair of new libraries have been making some noise: ActiveAdmin and RailsAdmin. How do they stack up to Typus? Read on, friend.

Continue reading "Rails Admin Interface Generators"

Static Asset Packaging for Rails 3 on Heroku

David Eisinger
David Eisinger, Senior Developer, March 29, 2011

Short Version: the easiest way to combine and minify static assets (CSS and Javascript) in your Rails 3 app running on Heroku is to use AssetPackager with this fork of Heroku Asset Packager. It just works.

Continue reading "Static Asset Packaging for Rails 3 on Heroku"

Bundler Best Practices

Chris Jones
Chris Jones, Developer, February 25, 2011

Bundler is a great tool to have in the Ruby toolbox, but it's also a bit mysterious to some developers. "Oh cool, I put my gems in this file, bundle install, and that's it. Wait, what's this Gemfile.lock thing? Should that go in my repo? What's the difference between bundle install and bundle update? How do I install my gems when I deploy? Where are my pants?" Let's take a tour of Bundler and find the answers to some of these questions.

Continue reading "Bundler Best Practices"

We're the Developers

at Viget Labs. We write about web development trends, tips, best practices, industry events, and our projects — all with an emphasis on Ruby on Rails.

Upcoming Events

Future Insights Live - April 29 to May 4
Future of Web Apps, Future of Web Design, Future of Mobile, and Future of Web in the Enterprise have joined forces to bring you our most comprehensive event EVER!

Contact Us

Have any questions, comments, ideas, or secrets to share? Let us know.


What color is the sky?

Sorry, you need to have Javascript enabled to use this form. (Don't blame us, blame the spammers!) If you'd like to contact us, please visit our Contact page.