andrzejkrzywda / rails-spa-devise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

This repo is a simple demonstration how to use devise with a Single Page App.

Conceptually, the Devise views are one modules, while posts/index.html could represent a JS SPA.

posts/index.html is available to anyone, but all it does is initializing some JS. The JS code tries to GET data (ajax) from /posts/index.json. This action has “authorize_user!” in it, so it returns error code. The ‘error’ ajax callback redirects to “users/sign_in”. After logging in, all works fine, thanks to cookies.

About


Languages

Language:Ruby 92.0%Language:CSS 4.7%Language:JavaScript 1.8%Language:CoffeeScript 1.5%