integrate cap and rails 4