No route matches “/users/sign_out” devise rails 3

I think the route for signing out is a DELETE method. This means that your sign out link needs to look like this: <%= link_to “Sign out”, destroy_user_session_path, :method => :delete %> Yours doesn’t include the :method => :delete part. Also, please note that for this to work you must also include <%= javascript_include_tag :defaults … Read more

How can I rename a database column in a Ruby on Rails migration?

rename_column :table, :old_column, :new_column You’ll probably want to create a separate migration to do this. (Rename FixColumnName as you will.): script/generate migration FixColumnName # creates db/migrate/xxxxxxxxxx_fix_column_name.rb Then edit the migration to do your will: # db/migrate/xxxxxxxxxx_fix_column_name.rb class FixColumnName < ActiveRecord::Migration def self.up rename_column :table_name, :old_column, :new_column end def self.down # rename back if you need … Read more

How to use ANY instead of IN in a WHERE clause?

There are two variants of IN expressions: expression IN (subquery) expression IN (value [, …]) Similarly, two variants with the ANY construct: expression operator ANY (subquery) expression operator ANY (array expression) A subquery works for either technique, but for the second form of each, IN expects a list of values (as defined in standard SQL) … Read more