Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7177283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:40:49+00:00 2026-05-28T16:40:49+00:00

Learning spine.js I completed both the tutorials no problem, seems like a great framework,

  • 0

Learning spine.js I completed both the tutorials no problem, seems like a great framework, but this simple little problem is driving me nuts, because I have no idea what I can do to fix it…

From what I understand the variable @list should be accessible by the .eco template (compiled by hem), but it’s not, has anybody else encountered this?

Can someone please show me where I am going wrong?

Users.coffee

Spine = require('spine')
User  = require('models/user')
$     = Spine.$

class Show extends Spine.Controller
  className: 'UserApp'

  events:
    'click .NewUser' : 'new'

  constructor: ->
    super    
    User.bind('create refresh change', @render)
    @active @render

  render: =>
    #get all users and render list
    @list= [1,2,3,4,5]
    console.log(@list)
    @html require('views/UserApp')(@list)

  new: ->
    @navigate('/users','create')

UserApp.eco

 <% if @list.length: %>
     <% for i in @list: %>
      <%= i %>
     <% end %>
    <% else: %>
     Why you no work!?
    <% end %>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:40:50+00:00Added an answer on May 28, 2026 at 4:40 pm
    @html require('views/UserApp')()
    

    expects an hash object as parameter. So, if you want to use a @list variable in your view (ala Rails I mean) you have to do something like the following:

    @html require('views/UserApp')(list: @list)
    

    where the key will be the name of your variable in the view. So using:

    @html require('views/UserApp')(@list)
    

    like you’re doing will bring to the view the @list variable as the current @ or this and in your view you should be able to use it in the following way:

    <% if @.length: %>
         <% for i in @: %>
          <%= i %>
         <% end %>
    <% else: %>
         Why you no work!?
    <% end %>
    

    But it’s not that readable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning Python using Dive Into Python 3 book. I like it, but
Learning Ruby. Needed to create a hash of arrays. This works... but I don't
Still learning this jQuery stuff.... I like this ajax page loader; it works for
Learning C at University. This is not a homework, but I was trying to
Still learning the ropes with Groovy, this problem has tripped me up since last
Learning a little about T-SQL, and thought an interesting exercise would be to generate
Im learning lisp and im pretty new at this so i was wondering... if
learning html/css here. I can't seem to understand how to tweak this drop down
For learning purposes I created a toy project using grails. In this project I
Learning the basics of XML for the first time from W3C tutorials. How are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.