Can't make Emblem.js work with Rails

174 views Asked by At

I'm trying to use Emblem.js to render Ember templates in a Rails app. Here is a part of my Gemfile:

gem 'ember-rails'
gem 'ember-source', '~> 1.9.0'
gem 'emblem-rails'
gem 'emblem-source', github: 'machty/emblem.js'

This is according to the installation instructions of emblem-rails gem: https://github.com/alexspeller/emblem-rails

I have a very basic app. This is the layout written in slim:

doctype html
html
  head
    title My App Title
    = stylesheet_link_tag    'application', media: 'all'
    = javascript_include_tag 'application'
    = csrf_meta_tags
  body

I also have a basic Ember-Rails app where I have my application template written with emblem /app/assets/javascripts/templates/application.emblem:

h1 Hello World

But I get the following error (even after restarting my puma server):

ArgumentError at /
wrong number of arguments (1 for 2)
  (in /Users/htaidirt/Code/MyApp/app/assets/javascripts/templates/application.emblem)

with a highlight to the layout at = javascript_include_tag 'application' line: https://www.dropbox.com/s/un8ixkpgvn81txi/Screen%20Shot%202015-07-29%20at%2019.00.46.png?dl=0?dl=1

Do you have any idea how can I fix that? Thanks.

1

There are 1 answers

2
Alexandr On BEST ANSWER

Had the same issue. Solved with

gem 'sprockets', '2.11.0'

gem 'ember-rails', '~> 0.19.0'

gem 'ember-source', '~> 1.13.5'

gem 'ember-emblem-template'

gem 'emblem-source', '~> 0.4'