Baking ActiveRecord Cookies With JSON

Our upcoming Mightyvites site has a nifty form where users can calculate the cost of their invitations. There are a number of options to choose from, and once a user makes the effort to price a package they shouldn’t lose their settings if they leave the page. It’s imperative that the form pick up where the user left off so that it is easy for them to continue with their purchase. That said I needed a way to persist their configuration, but I couldn’t rely on the database because the user very well may be anonymous. I also didn’t want to use the session because it will expire soon.
Read the rest of this entry »

Incoming search terms:

  • rails json cookie
  • rails json cookies
  • activerecord store json
  • mighty nice blog
  • rails cookie json
  • rails json session
  • json cookie
  • json cookie rails
  • rails session json
  • store json activerecord

Is JavaScript Disabled? Ask The User!

Any good web developer knows that you can’t rely on JavaScript to provide core site functionality. For now we still have to worry about that ever-shrinking group of users who either turn off JavaScript in their browser or who are using a browser which doesn’t support JavaScript. This is always an issue when developing for the modern web because you want to provide users with the snazzy effects and interfaces they have come to expect, but you still want your site to work without them. Much has been written about graceful degradation and its kinder sibling progressive enhancement (I particularly like this article). Both techniques offer sound principles for building fancy sites that still work without client-side scripting. However, both typically rely only on the user agent to let the web application know the browsing environment. In fact there is a human right there who can tell you better what they would like their experience to be. That’s why I like to use a little technique called “ask the user” to address the JavaScript problem. It’s not as serious sounding as those other two techniques, but I think it’s a happy medium. Here’s how it works.
Read the rest of this entry »

Incoming search terms:

  • ask user to enable javascript
  • asking user to enable javascript
  • number of users mightyvites com
  • prompt user to turn on javascript
  • javascript ask user
  • js disabled get user to enable it
  • prompt user enable javascript
  • prompt user to enable javascript
  • $_session[\nojs\]
  • prompt users to enable javascript