Skip to content

Instantly share code, notes, and snippets.

View rubyonrails3's full-sized avatar

Ismail Akram rubyonrails3

View GitHub Profile
@rubyonrails3
rubyonrails3 / hello.js
Created January 29, 2012 19:30
This is hello World in NodeJs with Socket.IO
var http = require('http'),
url = require('url'),
ios = require('socket.io'),
fs = require('fs');
var server = http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('<h1>Hello NodeJs</h1>');
});
@justinthiele
justinthiele / Readme.md
Created September 11, 2011 04:43
Retaining form data through a login process and resubmitting the form [Rails & Devise]

This is a feature I struggled with for quite awhile, so I thought I'd share my solution. The code is actually pretty simple once I got it figured out. Hopefully it will save somebody else some headaches.

So here's what we're doing

To create an easy on-boarding process, I've put a New List form on the front page of Favsi.com. However, creating a list requires the user to be authenticated, so I needed to create a way to retain the user's New List form data through the authentication/registration process, and then post it. Here's a screenshot of the front page: Favsi Front Page Form

The flow would go like this

  1. User goes to the front page.
  2. User fills out the New List form and presses the Create List button.