When you use after_sign_in_path_for, make sure your root controller is publicly accessible.

Sanitize to the rescue! →

Most of the applications we create these days usually have an admin interface where an user with necessary privileges is able to manage the application content, respecting some business rules. Thus it is required that part of this content is easily manageable, which means the user needs to be able to add some formatting to the content. For us, it usually means that the user has to input HTML tags. And it also means that the user can do things that might break our application.

Rails + SQL Server 2000 on Windows XP

Obviously they are not a perfect match, but somehow I need to get this done. I did this on Windows XP with SQL Server 2000 (PE) Service Pack 4.

  1. Install Ruby 1.9.2-p0
  2. Install DevKit
  3. Install rails gem install --version 2.3.9 rails
  4. Install ruby-odbc gem install ruby-odbc --platform=ruby
  5. Install activerecord-sqlserver-adapter gem install --version 2.3.10 activerecord-sqlserver-adapter
  6. Create an ODBC data source
  7. In config\database.yml,

adapter: sqlserver mode: odbc dsn: your_dsn_name host: localhost username: sa password: your_password database: your_database encoding: utf8

Bonus

If you wish to add some custom gem configuration , you should create .gemrc file in your home directory, mine is C:\Documents and Settings\username.

When running a single test unit

always include the test directory

ruby -Itest test/unit/category_test.rb