Internet Explorer 7 gets Authenticity Token Invalid from Rails

20 04 2009

Recently we had an issue where a client was unable to access his CMS. He was receiving an error ‘422 The change you wanted was rejected’. This was the production pretty message, caused by anĀ InvalidAuthenticityToken error. After much debugging, trying to turn off authenticity token filtering and removing before filters I took a stab in the dark.

The problem was that the site was on a sub-domain with an underscore in the name While all other browsers behaved perfectly, Internet Explorer 7 (and I believe 6 as well) had a tantrum and wouldn’t accept cookies. The solution was to change the site’s underscore to a hypen, making it Hope someone out there saves time time and hair with this one.

Vim + Screen + iTerm with 256 colours

7 04 2009

I’ve recently started using screen and have been thoroughly liking it. One issue I had was getting my full colourscheme with vim to work properly. In the end I did get it working and here I’ll outline the combination of apps and configuration that did the trick.

  1. Install iTerm Build from the iterm page on sourceforge. At the time of writing BuildĀ was available but it cut the bottom off my letters.
  2. Open up ‘Manage Profiles’ in the bookmarks menu (or alt-cmd-b), expand the ‘Terminal Profiles’ menu and select ‘Default’. Now set ‘type’ to xterm-256color. It should be in the drop down.
  3. Download screen from Philip Halstrom’s site and extract the files.
  4. Open terminal cd into the directory with the screen files and run:
      $ ./configure --enable-locale \
         --enable-telnet \
         --enable-colors256 \
         --enable-rxvt_osc \
      $ make
      $ make install
  5. Now edit your screen config file ‘~/.screenrc’ and add the following lines:
      startup_message off
      #terminfo and termcap for nice 256 color terminal
      # allow bold colors - necessary for some reason
      attrcolor b ".I"
      # erase background with current bg color
      defbce "on"
  6. Now add the following lines to your vim config ‘~/.vimrc’, in this example I’ve included my colourscheme; railscasts. Make sure the first line in this example comes before any color configuration in your vimrc file.
      set t_Co=256
      colorscheme railscasts

A good deal of the information in this post came from Philip Halstrom’s post. He includes a few more lines in his screenrc, these caused jumbled letters to appear in my terminal. I’m guessing they addressed an issue with an older version of iterm that has since been resolved.