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 8600485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:37:39+00:00 2026-06-12T01:37:39+00:00

I have a project model with a name:string and state:integer. There are 5 types

  • 0

I have a project model with a name:string and state:integer. There are 5 types of states. For example I want to put all projects with state 3 into the #prospects div. How can I make this work?

appendProject: (project) =>
  # this renders all projects
  view = new Trackproject.Views.Project(model: project)
  @$('#projects').append(view.render().el)
  # this is how i want it to work
  @$('#prospects').append(state3.render().el)
  @$('#upcoming').append(state4.render().el)

I think you can filter it in the collection file but I can’t figure out how to load it into the views.

I work with Rails, Backbone and Coffeescript

  • 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-06-12T01:37:40+00:00Added an answer on June 12, 2026 at 1:37 am

    Right answer is

      appendProject: (project) =>
        view = new Trackproject.Views.Project(
          model: project
        )
        state = project.get("state")
        if state is 1
          @$("#projects").append view.render().el
        else if state is 2
          @$("#prospects").append view.render().el
        else if state is 3
          @$("#upcoming").append view.render().el
        else if state is 4
          @$("#current").append view.render().el
        else if state is 5
          @$("#completed").append view.render().el
        else
          @$("#projects").append view.render().el
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project which exposes object model to use by different types of
I have this Project model: class Project < ActiveRecord::Base validates :status, :inclusion => {
I have a Project model similar to: class Project(models.Model): ... lead_analyst=models.ForeignKey(User, related_name='lead_analyst') ... I
I have a Project model and it has some text attributes, one is summary.
I have a M2M field in my django model project. In my view I
In my project I have a model where I use Imagekit to process an
I have a Java project that I'm trying to implement with a model-view-controller design.
I have a Python project with following directory structure: /(some files) /model/(python files) /tools/(more
I have an existing model for my project. I would like to switch to
I have the following model in a project: class CarAssignment(models.Model): leg = models.ForeignKey(Leg, null=True,

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.