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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:07:32+00:00 2026-05-22T15:07:32+00:00

In the couchDB guide, Managing Design Documents , they state that The _attachments directory

  • 0

In the couchDB guide, Managing Design Documents, they state that

The _attachments directory contains files that are saved to the Sofa design document as binary attachments. CouchDB serves attachments directly (instead of including them in a JSON wrapper), so this is where we store JavaScript, CSS, and HTML files that the browser will access directly.

then further down they create a separate folder to store their templates, outside the _attachments folder. This is something that’s been puzzling me for a while now. They only way I’ve been able to include templates in my show functions is if they reside outside the _attachments folder.

Can I place my templates in the _attachments folder, or should they be placed outside the _attachments folder?

If I can/should place them inside the _attachments folder, how can I call them in my show functions?

  • 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-22T15:07:33+00:00Added an answer on May 22, 2026 at 3:07 pm

    If you want to render the templates server-side (_show and _list functions) they must not be in _attachments because show and list functions do not have access to attachments. In these functions, the variable this is a Javascript object, copied from the design document. this.templates.foo would come from the templates/foo.html file in your project.

    If you want to render the templates client (browser) side, they may be in attachments, or in the design document. It depends what works better for you. With templates stored in attachments, you can fetch them directly, and use them on the client; you can simply link to it in your app or web page. You can also leave the templates in the design document and let the client fetch that whole document. Then, the client can use whichever templates it wants from the ddoc.

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

Sidebar

Related Questions

I have create CouchDB database with documents that have slash (/) in the document
I'm exploring CouchDB this morning, and am playing with a document schema that looks
CouchDB, version 0.10.0, using native erlang views. I have a simple document of the
How can I retrieve document from CouchDB based on its field, not by ID?
I am already excited about document databases and especially about CouchDB's simplicity. But I
I am working on a project that is going to use CouchDB for flexible
I was looking into the possibility of using CouchDB. I heard that it was
We are writing a Rails application that is using CouchDB as its data store.
In CouchDb's documentation, the described method of deleting document attachments is to send a
I've installed CouchDB on my vagrant 0.9.0 box that is running CentOS 6.2 .

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.