sporkd / html5-rails

Generate Html5 Boilerplate for your Rails apps!
https://github.com/sporkd/html5-rails
MIT License
239 stars 33 forks source link

html_tag(): undefined method `options' for nil:NilClass when having application.html.slim instead of haml #26

Closed jmuheim closed 11 years ago

jmuheim commented 11 years ago

My SLIM file:

doctype html
- html_tag class: "no-js" do # Adds IE-specific CSS classes
  = render "head"

  body class=controller.controller_name
    = render "chromeframe"
    = render "header"

    #main role="main"
      = render "flashes"
      = yield

    = render "footer"

    -# Javascript at the bottom for fast page loading
    = render "javascripts"

Output when loading page:

undefined method `options' for nil:NilClass

#<Class:0x007fd985f61bc8>#_app_views_layouts_application_html_slim__2652867622890682822_70286116180140
app/views/layouts/application.html.slim, line 2

Any help on that? Before when I used HAML this worked perfectly.

errm commented 11 years ago

Could you update the gem and try again?

sporkd commented 11 years ago

The html_tag helper is not compatible with slim because it lacks the ability to do something like slim_concat. See https://groups.google.com/forum/#!msg/slim-template/7gbG1wzDxAs/C06ivayJe20J

There might be a way to make it work, but I couldn't figure it out. However, adding the slim-rails gem to your gemfile will now generate a working slim layout with inline html tags.