eco

How to display Backbone nested attribute using Eco?

微笑、不失礼 提交于 2020-01-25 04:33:06
问题 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 I'm getting Uncaught TypeError: Cannot call method 'get' of undefined However, I can get <%= @stream.get('stream_type') %> to work. Here's the REST API data: [ : { : : "id":"5004095283de4ca9ff000005", : : "created_at":"2012-07-16T12:30:10Z", : :

Eco template renders integer when using 'end' statement

不羁的心 提交于 2019-12-10 11:55:14
问题 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 when I use the end statement to terminate a conditional block. Here's some code that is demonstrating the error for me: <% if true: %>Hello World!<% end %> I would expect this to render Hello World! into the containing element. However, it's

Backbone, Bootstrap modal within template not showing

≡放荡痞女 提交于 2019-12-06 10:23:55
问题 I am trying to generate a modal for each of my posts so that each post has a modal containing the post content(and eventually comments). When the comment link is clicked the modal will appear. The thing is I have to create a bootstrap modal block for each post so i decided it would be easiest to do this in my backbone template. Why isn't this working? Here is my code: app/assets/templates/posts/index.jst.eco <% for post in @posts.models: %> <tbody><td> <%= post.get('content') %> </td></tbody>

Backbone, Bootstrap modal within template not showing

北慕城南 提交于 2019-12-04 15:10:41
I am trying to generate a modal for each of my posts so that each post has a modal containing the post content(and eventually comments). When the comment link is clicked the modal will appear. The thing is I have to create a bootstrap modal block for each post so i decided it would be easiest to do this in my backbone template. Why isn't this working? Here is my code: app/assets/templates/posts/index.jst.eco <% for post in @posts.models: %> <tbody><td> <%= post.get('content') %> </td></tbody> <tr><td> <a href="#<%= post.get('id') %>">Comment</a> </td></tr> <div class="modal" id="post-<%= post