A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://github.com/olivernn/notepad below:

olivernn/notepad: Example app for using davis.js with mustache templates on both server and client

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.

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.

To get the app running locally do the following

bundle
rake db:schema:load
rails s
open http://localhost:3000/notes

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4