authentication - Rails: How to separate static content and application but while maintaining a connection between the 2? -
ok question might sound bit weird, let me try explain trying achieve here.
i need: - static pages: home page, us, etc. usual suspects - full complex rails web app
the web app being heart of system have lot of stuff, including user authentication (with devise way). application have standard navigation menu possible actions changing depending on user status (login or not, admin or not, etc).
until now, nothing out of ordinary.
however unrelated reason, must have entry point of whole system home page hosted on server (ergh).
so now, since home page , other static pages on server , application on server b how can maintain contact between 2 ?
meaning: keep navigation menu dynamic on static pages, have sign-in / sign-up form on static server registering account on "real" application server ? can share same database, no pb there.
any pointers on how ? not put iframes on static site...
thanks !
alex
signin/signup stuff, can have forms action going b , redirecting a.
to display right stuff in menus can make jsonp call(as chris said) fetch either entire header or specific parts of header dynamic.
if looking include users name, can store name in cookie , use javascript display in header.
if there's no cookie display link login/signup.
edit: jsonp calls take @ javascript framework make call client side, use jquery http://api.jquery.com/jquery.ajax (and @ jsonp options).
Comments
Post a Comment