Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Example app for using davis.js with mustache templates on both server and client
Ruby JavaScript CoffeeScript
branch: master

This branch is 8 commits ahead, 15 commits behind olivernn:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
lib/tasks
public
script
test
vendor/plugins
.gitignore
Cakefile
Gemfile
Gemfile.lock
README.markdown
Rakefile
config.ru

README.markdown

NotePad

This is a Rails 3 application using html5 pushState with Davis.js and Mustache templates via Poirot, take a look at it running here.

The same partials are used client and server side to render the list of notes and the note display area of the screen, mustache makes this possible.

All links are bound to by a Davis.js application which handles the requests from clicking links and submitting forms client side.

The app should work equally well with or without JavaScript disabled, the JavaScript version doesn't do any fancy animation so it might be hard to tell, but when enabled it is the Davis.js application that it is taking care of rendering notes.

Code

The interesting code is in the JavaScripts folder, start by looking at app.js which is where the Davis.js app and its routes are defined. A very simple view factory handles the client side templating using Handlebars.js and the Note model uses the excellent js-model.

Running Locally

To get the app running locally do the following

bundle
rake db:schema:load
rails s
open http://localhost:3000/notes
Something went wrong with that request. Please try again.