1

I'm new to rails, so please excuse me for asking a likely-basic question. I know the /assets is for files that are automatically loaded on a page request. But doesn't this mean that the server will always send all the files in this folder? Something doesn't seem right to me here.

This issue came up because I have been loading my css files from the /public folder, but realized that when I run my app in Firefox, none of the classes are recognized.

Anyway, I know that convention over configuration is a big thing in rails, so what is the convention for specifying what css/javascript files I want to be loaded on a per-page basis?

1
  • Question is kind of vague. What libraries? What classes? What lives in public and what lives in assets? I tried my best, but not sure it's "correct". Commented Jul 25, 2013 at 3:56

1 Answer 1

1

Your answers are probably in the Asset Pipeline Guide, but I'll provide some info here too.

The server will only send these files all the time when your server is running in the development environment. In production, these files should be precompiled (using rake assets:precompile) so that as minimal amount of files are served as possible.

I'd encourage you to give the guide a more thorough read through for what I mean.

Sign up to request clarification or add additional context in comments.

1 Comment

Great, this is the resource I needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.