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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:06:45+00:00 2026-05-30T08:06:45+00:00

I have a backbone.js front-end and Rails backend, and all my template files are

  • 0

I have a backbone.js front-end and Rails backend, and all my template files are in the assets directory.

I want to implement a select list in one of my templates, with the data coming from a controller.

For example, I have an AccountController and I want the user to be able to select from available accounts. Right now, I’ve got an AJAX request to build the accounts select list, but that isn’t efficient.

Is there a way to inject my Rails data into my templates before the templates are sent to the user?

  • 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-30T08:06:47+00:00Added an answer on May 30, 2026 at 8:06 am

    Assuming you are OK with using mustache.js to render your templates, poirot can do exactly what you’re trying to do. With this you can have rails data rendered into the template before rendering the template on the front-end, and you can also use the same mustache template for both back-end and front-end. Keep it DRY yo.

    Another way to solve the problem would be to name your JS files like so: example.js.erb, which allow you to render the select HTML or data directly to the JS file, and use it as needed.

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

Sidebar

Related Questions

I have a simple rails 3.2 app with a Backbone.js front-end. I have the
I have a rails app with a Backbone.js front-end. In my Backbone model/collection definition,
I am more into front end development and have recently started exploring Backbone.js into
I have Backbone.js collection that holds (for example) 30 items. I want to pass
i have a backbone.js api i want to use in an ExtJS app. Extjs
I have a rails-backbone project that generates jst.ejs templates. I'd like to include some
Newbie backbone question: Context: Building a shopping list with backbone I have a model
I have a backbone.js app ( www.github.com/juggy/job-board ) where I want to bind my
I have this backbone that is working fine, i just want to render the
I have been working with Django as backend and using jQuery for the front

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.