htmlrubyhamlcuba

Can Cuba (ruby framework) load HTML instead of HAML


Currently working on a Cuba project, bunch of HAML file but for improving UI I still prefer pure HTML, but as I tried, It's seems very complicate to rebuild every thing to get rid of HAML.

Any clues?


Solution

  • From a quick glance at the docs, Cuba can use any template tilt supports. So if you want to switch to ERB (HTML-based template), you'd switch the template engine:

    Cuba.settings[:render][:template_engine] = "erb"
    

    And then re-write all of your view code in ERB. Which seems like a lot of work compared to getting used to HAML, but alas.

    There are tools to make HAML->ERB conversion easier, like herbalizer.