Some changes in rails

It wasn't work correctly for me. Now it works.