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
0
votes
1 answer

Integers Being Added to Array

I'm trying to use an array of objects to simplify maintaining a list of HTML buttons. Here's my code: <% links = [{url:"https://github.com/drguildo", icon:"github"}, %> <% {url:"http://www.flickr.com/photos/drguildo/", icon:"flickr"}, %> <%…
Simon Morgan
  • 2,018
  • 5
  • 23
  • 36
0
votes
1 answer

Nested if is not working in eco template engine

I was trying use nested if in eco template. Here is my code <% for document in @getCollection('posts').toJSON()[@document.page.startIdx...@document.page.endIdx]: %> <% if true %>

<%= new…

kunjee
  • 2,739
  • 1
  • 23
  • 38
0
votes
1 answer

CoffeeScript eco - run code on event

I have the following code inside index.eco <% for drawing, index in @drawings: %>
  • <%=drawing.name%>

    Giannis
    • 5,286
    • 15
    • 58
    • 113
  • 0
    votes
    0 answers

    Undefined method `rails_safe_buffer_class'

    In my rails project i'm using haml_assets gem The content of registration.jst.eco.haml file: = form_for :contact, url: "javascript_not_working", html: {:class => :edit_contact, :method => :put} do |f| = f.label :name, "Name" = f.text_field…
    megas
    • 21,401
    • 12
    • 79
    • 130
    0
    votes
    1 answer

    Accessing nested JSON objects in Backbone

    I've a simple scenario where I return JSON with nested objects with a Rails backend. I'm having trouble accessing the attributes of the nested object. Example JSON: [{ category_id: 2, id: 34, name: "red", category: { name: "color" …
    0
    votes
    1 answer

    Preload selected options for select

    I am using a lot of things (Rails, Backbone.JS, HTML) and I don't know how to load a selected value for a select. I am in a "edit" form and I want to load the info from the server (Rails API) and load the selected option in my form. In rails we have…
    fabricioflores
    • 375
    • 5
    • 15
    0
    votes
    1 answer

    Backbone template variables only working with if I use this in template

    In my template I have to put this.name and this.gravatar to access my user model data attributes. If I don't I get an error message when the template attempts to render. Everything works but I don't see any examples where they put this. in the…
    ChickenFur
    • 2,360
    • 3
    • 20
    • 26
    0
    votes
    1 answer

    Rendering views in spineJS?

    Just so you know this is my first question here on stackoverflow, so I apologize if something is wrong with my question. OK, So I have just started using spine, it is my first delve into MVC frameworks and I am having trouble with rendering a .eco…
    Ben Smith
    • 51
    • 4
    0
    votes
    1 answer

    Using Eco and CoffeeScript

    How can I use If statement to specific a variable that is defined in the docpad.coffee file. I want to do something like this: <% if sponsor.type == 'Gold': %>
    0
    votes
    3 answers

    backbone templates: index.jst.eco to index.jst.ejs

    Specific question: this code works in a backbone template index.jst.eco, but it doesn't work in index.jst.ejs <% for entry in @entries.models: %>
  • <%= entry.get('name') %>
  • <% end %>
    I'd like to know why (i.e. how to fix it for…
    Leahcim
    • 40,649
    • 59
    • 195
    • 334
    0
    votes
    2 answers

    Eco template renders integer when using 'end' statement

    I have a pretty simple Backbone View that I'd like to have render some blocks of HTML conditionally. I'm seeing a behavior where following the conditionally rendered HTML there is a integer rendered as well. From what I can tell, it seems to happen…
    -1
    votes
    1 answer

    I wanna make eco bot on discord.py

    CODE import discord from discord.ext import commands import sqlite3 from config import settings bot = commands.Bot(command_prefix = settings['prefix'], intents = discord.Intents.all()) bot.remove_command('help') connection =…
    Venzo
    • 1
    -1
    votes
    2 answers

    How can I say that in php language if (isset($video_url)¬ just only https sting can be found)?

    I have a field inside the WordPress admin area, in the post-new.php section. I use the latest version of WordPress, as well as the Advanced Custom Fields plugin so that I can write out this field in header.php. I use this field for the og:video tag,…
    user3545446
    • 137
    • 8
    -1
    votes
    1 answer

    Eco with statement if

    It's Eco, the problem is it should add button just for some models(backbone) in partial, but the statment if not worked.The variables are accessible, but the owner.id a is string and current_user.id is a number. <% if @owner?.id is current_user.id:…
    1 2 3
    4