A LIST Apart: For People Who Make Websites

No. 324

Discuss: Rapid Prototyping with Sinatra

Pages

 1 2 >

1 Excellent introduction

Thanks for this – that really was a good introduction. I’ve done quite a lot of Rails already, so there was nothing scary there, but I can imagine that even someone with no backend experience would be able to follow your steps and get something running fairly quickly.

posted at 08:04 am on February 22, 2011 by skilldrick

2 Easy Ruby install on Mac OS X

An even easier install of Ruby on Mac OS X is to use RVM (Ruby Version Manager).

Install RVM wiht one simple command:
prompt> bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

Then you can install Ruby (1.8.7 or 1.9.2) by simply typing:
prompt> rvm install 1.9.2

If using RVM you don’t need to use sudo to install gems.
prompt> gem install sinatra

posted at 10:50 am on February 22, 2011 by nate

3

Good intro. I’ve been using Sinatra for prototyping web apps for a while now and agree that it’s the best tool for the job. Someday I’ll write more on the topic and the tools I use, but for those interested, check out the following projects that allow for fast prototyping with Sinatra:

  • My Git Deploy Workflow — Combining GIT and Sinatra make it easy to deploy your prototypes to users
  • Serve — a small Rack-based web server and rapid prototyping framework for Web applications (specifically Rails apps)
  • Faker — a simple gem that makes it easy to stuff your app with fake data
  • Haml — Why write HTML if you can write HAML?
  • Padrino — a nice lightweight framework you can use to bootstrap an app with. Start your app as a prototype, but then evolve it to a real app. You can also use Padrino’s excellent helpers standalone inside of Sinatra.

posted at 02:11 pm on February 22, 2011 by rmanalan

4 Restart server?

You have to restart the server if you make changes to the ruby code (although not if you only make changes to the .erb files). That’s really a pain, even though it’s pretty quick. Kind of slows down the rapid prototyping. Is there a way around this? Rails has the “development” mode which is slower, but which lets you see changes without a server restart.

posted at 02:52 pm on February 22, 2011 by nyarlathotep

5 Re: Restart Server

@nyarlathotep Yes, that’s correct about the .erb files.

There is gem called shotgun you can use which makes Sinatra work like Rails’ development mode reloading your code on every request. To use it, `sudo gem install shotgun` then start the app with `shotgun myapp.rb` instead of `ruby myapp.rb` and it should start running on port 9393.

posted at 03:37 pm on February 22, 2011 by Al Shaw

6 Re: Restart Server

Another alternative that’s actually better than Shotgun is Rerun. Rerun only restarts the server if an .rb or .ru file changes. Shotgun reloads the code on each request.

posted at 04:56 pm on February 22, 2011 by rmanalan

7 Done something similar

We’ve been doing something similar for a few years with XML/XSLT/CSS/jQuery. It’s only slightly less flexible, but it allows us to explore a variety of situations and data possibilities without needing to spin up a server. It also assists us by becoming the training environment once the solution is set and has the benefit of running just about anywhere, even off of a CD or thumb drive.

posted at 03:53 pm on February 24, 2011 by Michael Havard

8 Great Intro to Sinatra

Thanks for the great intro to Sinatra. I agree Nate RVM makes dealing with multiple versions of Ruby a breeze. Great links in the discussion too.

I’m sure this will likely be the first foray into the terminal for many readers. I’d like to encourage any who are terminal novices (having come from a design background) that while it’s scary at first, it’s very empowering once you get familiar with it. This article is a great place to start.

posted at 02:14 am on February 26, 2011 by Chad Mefferd

9 Great Overview

This is a great intro into the world of Sinatra. Our team has been developing in Sinatra for the last couple of years and have found it incredibly quick for small and medium-sized commercial sites. One of its key strengths (vs PHP which we used to use), is how easy it is for our designers to understand what is going on on the views and even write basic application logic themselves. Teamed with haml, git and rerun, it’s a dream development environment.

In the last year we’ve built a couple of larger sites in Sinatra and although they’ve worked well, we’re also experimenting with Rails 3 to see if its ‘convention over configuration’ paradigm offers an advantage over the Sinatra’s relative anarchy for larger applications. At the moment, the jury’s still out.

posted at 05:51 pm on February 28, 2011 by pjosborne

10 A newbie

Would making a clickable prototype in Fireworks be much different, and if so, how? As a designer with a very beginning knowlegde on HTML/CSS an coding at all, the article, at a quick glance, looks like another batch of code to wrestle with, which is something I hope to avoid when making a quick, simple prototype.

posted at 01:53 pm on March 5, 2011 by Stefangus

Pages

 1 2 >

Got something to say?

Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.

Create a new account or sign in below if you’d like to leave a comment.

Remember me

Forgot your password?

Subscribe to this article's comments: RSS (what’s this?)