layouts, controller and start of activerecord work from class