Coder Social home page Coder Social logo

dust-rails's Issues

Unable to change template root path.

I am trying to change the template root path by setting
config.dust.template_root = 'app/assets/javascripts/' in application.rb

The config does not seem to be taking hold though.

Also template that I have placed in app/assets/javascripts/templates seems to get registered as "templates/feed_block" instead of "feed_block"

I am using rails 3.2.0

unexpected token: operator (<) when precompiling

I am getting the following

$ bin/rake assets:precompile
/Users/jpaas/.rvm/rubies/ruby-1.9.3-p327/bin/ruby bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Unexpected token: operator (<) (line: 18169, col: 1, pos: 543284)

undefined

My project only has 1 dust template and this error goes away as soon as I remove it from the application.js manifest. So whatever it's generating, precompile doesn't like it.

This is pretty serious problem because I can't deploy to heroku without precompilation. :(

couldn't find file 'dust-core'

Hi,

I'm really looking forward to trying out your dust-rails gem!

Followed the README to the dot - included in Gemfile, bundle installed, added a demo.js.dust file to a new templates folder under app/assets/javascripts and added the 2 requires, and the dust.render-call to application.js

I'm

[rails 3] bundle show rails
/Users/walther/.rvm/gems/ruby-1.9.2-p290@oxenserver/gems/rails-3.2.1

[rails 3] bundle show dust-rails
/Users/walther/.rvm/gems/ruby-1.9.2-p290@oxenserver/gems/dust-rails-0.3.0

The trace (well, trace is perhaps somewhat misleading but anyways) shows

ActionView::Template::Error (couldn't find file 'dust-core'
  (in /Users/walther/Documents/RailsProjects/oxen.3.2/app/assets/javascripts/application.js:12)):
    14:         %link{ href: 'http://fonts.googleapis.com/css?family=Norican', rel:'stylesheet', type:'text/css'}
    15:         / %link{ href:'http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic|Ubuntu+Condensed', rel:'stylesheet', type: 'text/css'}
    16:         = stylesheet_link_tag    "application"  
    17:         = javascript_include_tag "application"
    18:         = csrf_meta_tags
    19:         = belongs_meta_tags
    20:         
  app/views/layouts/application.haml:17:in `_app_views_layouts_application_haml__1776395587685589947_70176145429920'
  app/controllers/abstract_actions_controller.rb:44:in `index'


  Rendered /Users/walther/.rvm/gems/ruby-1.9.2-p290@oxenserver/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (5.6ms)
  Rendered /Users/walther/.rvm/gems/ruby-1.9.2-p290@oxenserver/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.6ms)
  Rendered /Users/walther/.rvm/gems/ruby-1.9.2-p290@oxenserver/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (11.5ms)

My app/assets/javascripts/application.js looks like this:

//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require bootstrap
//= require jquery_widgets
//= require dust-core
//= require_tree ./templates
//= require_tree .
//= require desktop
//
$(function() {
  $('a[data-code]').click(function() {
    $('pre').toggle();
  });
  $('label').hover(function() {
    $(this).parent().find('p.help-block').toggle();
  });
});

dust.render("messages", {name: "Fred", count: 10}, function(err, out) {
        console.log(out);
    });

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.