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

  • Home
  • SEARCH
  • 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 6869285
In Process

The Archive Base Latest Questions

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

I am using Rails 3.1 and under assets I have files like this: assets

  • 0

I am using Rails 3.1 and under assets I have files like this:

assets
  javascripts
    admin
        admin.js
        a1.js
    client
       client.js
        c1.js

admin.js looks like this

//
//= require jquery
//= require jquery_ujs
//= require a1

client.js looks like this

//
//= require jquery
//= require c1

Everything works fine in development mode. When I do rake assets:precompile then I do not see any javascript files in public/assets. I do see all the stylesheets in public/assets.

I think this has to do with the fact that manifest files (admin.js and client.js) in this case are in subdirectory.

So is this true that rake assets:precompile does not look into subdirectories?

Any suggestions on how to fix this. I prefer to have the files the way I laid out because I have a bunch of javascript files.

  • 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-27T03:32:22+00:00Added an answer on May 27, 2026 at 3:32 am

    There is a precompile array in the Rails config that sets what files to precompile. application.js and application.css in any directory.

    You will need to add your files to the precompile array:

    config.assets.precompile += ['admin/admin.js', 'client/client.js']
    

    And they should be accessible via:

    javascript_include_tag "admin/admin.js"
    

    and

    javascript_include_tag "client/client.js"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have all the javascript files under app/assets/javascripts Some of the javascript files application.js
I'm using the devise authentication plugin under rails 3. At the moment, I have
I'm using the devise authentication plugin under rails 3. At the moment, I have
Using Rails 3.2.2 and ruby 1.9.2 and I am not able to serve assets
Using Rails 3.2. I have an individual Shop post, and each shop has reviews.
I have been using the less-rails-bootstrap gem from https://github.com/metaskills/less-rails-bootstrap in my rails 3.1 project.
I'm new to Rails (using 3.1) and am looking to have a URL that
I'm using the jQuery Tools scrollable library in my Rails 3.1 site with the
I am learning rails by following the Rails Tutorial under Ubuntu. I have been
For some reason, the js files under app/asset/javascripts folder are no longer being requested

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.