RailsTip 3 – Configure sign_out method in Rails Devise Gem

Devise gem is one of the most popular gem for creating user login and signup.

The /logout action is by default set to :DELETE inside devise.rb . Most of the browsers only support :GET and :POST.

To change the method of /logout to :GET make following changes in devise.rb

config.sign_out_via = :get

Cheers !!


Rails tip #2 How to add css class on rails form

At times its required to make pretty . Forms can be created using form_for or form_tag

To add css class to form_for

  form_for @user, :html=>{:class=> "foo"}

To add css class to form_tag

  form_tag({:action => 'new',...}, {:class => 'my_form'}) do

Happy Coding !!