Aside from the AI, I'd take a step back and ask what the benefit is of translating clunky html/css into ruby. The result is harder to read than the html/css, reminds me of why I use ruby less these days, because it wants to wrap the front end in back end code