Questions tagged [eco]

Embedded Coffeescript (ECO) templates lets you embed coffeescript directly in your templates.

Embedded Coffeescript (ECO) templates lets you embed coffeescript directly in your templates.

ECO templating documentation and code are available at https://github.com/sstephenson/eco.

59 questions
2
votes
3 answers

How to print result of _each method in eco template

I'm sure I'm doing pretty simple wrong but can't seem to find an explanation. I've got the following line in my template which is not printing any values to the html output: <%= _.each(@place.get("hash"),(count, tag) -> "#{tag} ") %> This line is…
socratic_singh
  • 183
  • 1
  • 13
1
vote
1 answer

Is there an event fired after an eco template is rendered

I need to find a way to attach a jQuery autocomplete handler on to an input field that is rendered as part of an eco template. Here's what works fine when the input field is on the page in the markup HTML:
slarti42uk
  • 451
  • 3
  • 9
1
vote
1 answer

How to create MySQL database connection in Coffeescript

How to connect MySQL database in CoffeeScript. How to run this.I created MySQL connection using node.js and display record in terminal but how to display this on browser.I am using ECO templating for displaying on browser. I need database connection…
Darshika
  • 31
  • 6
1
vote
4 answers

Counting down in a loop to zero by the number being given

I am trying to write a while loop to determine the number is being given to count down to 0. Also, if there's no argument given, must display "no parameters given. Now I have it counting down but the last number is not being 0 and as it is counting…
Mark
  • 27
  • 1
  • 1
  • 4
1
vote
1 answer

JST in Rails 4 app, using backbone.js

I am attempting to migrate a simple rails 4 app from server-side .erb (or .haml) to a single-page-app using backbone.js. Since I am new to this, I followed a Railcast tutorial, #323. The tutorial was done using Rails 3.2, but I used my current…
explainer
  • 1,345
  • 3
  • 11
  • 25
1
vote
2 answers

Accessing instance methods in Eco templates using Marionette.js

I have simple controller @Blobber.module "PlacesApp.Show", (Show, App, Backbone, Marionette, $, _) -> Show.Controller = showPlace: (place) -> showView = @getShowView place App.mainRegion.show showView getShowView: (place)…
wuliwong
  • 4,238
  • 9
  • 41
  • 69
1
vote
1 answer

How to show the "upcoming" content based on its date on Docpad?

I'm trying to promote a content on a page. This content should the upcoming content, i.e. the next one in all of the same type ("event"). Here's how metadata look like : --- layout: event date: 2013-12-11 title: Cool event --- The docpad.coffee…
DjebbZ
  • 1,594
  • 1
  • 18
  • 34
1
vote
1 answer

Using Rails' view helpers inside javascript templates

I'd like to be able to use some of rails' view and form helpers, such as <%= image_tag .. %> or <%= select_tag .. %> inside my javascript templates. I read this thread that suggested pre-rendering the erb as a string in some javascript variable and…
sa125
  • 28,121
  • 38
  • 111
  • 153
1
vote
0 answers

How to display Backbone nested attribute using Eco?

I've followed Ryan Bates' example on Backbone.js to start a project using Backbone + Eco. It's great. However, I'm stuck trying to display a nested attribute. For example, I'm trying to do this: <%= @stream.user.get('name') %> in index.jst.eco and…
netwire
  • 7,108
  • 12
  • 52
  • 86
1
vote
0 answers

Use partials on eco engine template

I'm trying something like this: < %- @partial "includes/header" % > But nothing is printed. I'm using Tower.js. I tested it without Tower and works fine. EJS and some others template engines had the same problem. Just Coffekup worked fine with…
Rafael Motta
  • 2,328
  • 2
  • 19
  • 18
1
vote
0 answers

Sprockets: concatenate Eco templates and remove duplicated auxiliary functions

I'm using Sprockets to compile Eco templates and serve them concatenated as one JS file. So, for example, if i had these two templates: template1.jst.eco: Awesome template 1 template2.jst.eco: Awesome template 2 And then i include…
epidemian
  • 18,817
  • 3
  • 62
  • 71
1
vote
2 answers

Backbone.js template error with coffeescript and eco templating language

Solved: I have a backbone(0.9.2) written in coffeescript as follows class Animal.Views.Cats extends Backbone.View template: JST['animals/cats'] ... ... render: -> $(@el).html(@template()) this With this coffeescript code, when i execute in…
0
votes
2 answers

Surround Embedded Coffeescript in ECO in VIM

Are there any shortcuts to surround embedded Coffeescript (in eco templates) in VIM? <%= @something %> Whether in insert mode or not?
KendallB
  • 4,799
  • 4
  • 19
  • 21
0
votes
1 answer

How do I display an Eco Template on my webpage?

I've recently started learning how to create webpages and I need help learning Eco Templates. I am trying to display data in a template on my webpage. This is an example of the line of code in my script tags in the body:
Mike
  • 1
  • 1
0
votes
0 answers

Heroku verification

Why do I keep getting the error message "Could not complete the action. Please try again later." While trying to verify my account using USD debit card in Nigeria for Eco Dyno payment? I was trying to add my USD debit card for Dyno payment.