added the main structure in rails