Questions tagged [assets]

1. Non-code files packed with an application (example, data or media files). 2. From a security point of view - any data or resource that should be (or can be) protected.

3549 questions
35
votes
8 answers

Yii2 assets clear cache

Everytime I update my css or js files in infoweb\menu\module\assets, I have to empty the backend\web\assets folder is there a way to automatically clear the assets cache?
Ruben
  • 8,956
  • 14
  • 63
  • 102
35
votes
4 answers

Laravel assets url

I have installed Laravel and began trying to write an app. I made some directories for my assets in the same directory as /app. But when I try to visit an image in my localhost for example: http://localhost/assets/images/image.png I've also tried…
vikingcode
  • 613
  • 1
  • 8
  • 15
34
votes
18 answers

CSS is not loading in app

CSS won't load in my rails app. This is index.html.erb file located in view/products:

Listing products

<% @products.each do |product| %>
<%=…
Jamie
  • 393
  • 1
  • 3
  • 7
33
votes
1 answer

getAssets(); from another class

I have a simple read a txt-file function. AssetManager mngr = getAssets(); InputStream is = mngr.open("textdb.txt"); It works from my main activity. But if I use the same code in a separate class, getAssets() just return null / crash. I am unable…
jonassvensson
  • 491
  • 1
  • 6
  • 11
32
votes
5 answers

Official way of adding custom fonts to Rails 4?

I'm researching how to add custom fonts to my Rails app, e.g. by adding a fonts folder in the assets folder - and I cannot find an "official" Rails way on how to do this. Yes, there are plenty of questions/answers here on SO about the matter, all…
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232
31
votes
1 answer

Get NGINX to serve .gz compressed asset files

Rails 3.1 has a convenient system which can compress files into .gz files. However, instead what I've done is I've moved all the asset files that are created with assets:precompile to a static webserver. This all works, but how can I get nginx to…
matsko
  • 21,895
  • 21
  • 102
  • 144
30
votes
8 answers

cell imageView in UITableView doesn't appear until selected

Here is a video of the problem: http://youtu.be/Jid0PO2HgcU I have a problem when trying to set the image for the [cell imageView] in a UITableView from the asset library. The image is loaded but it doesn't appear in the cell until I touch…
Ali
  • 4,205
  • 4
  • 25
  • 40
30
votes
2 answers

How to avoid two files in project view when creating a custom importer in Unity3D?

NOTE: I'm casting a wider net than Unity Answers, my original question can be found here. I've created a ProTools CueSheet importer. It uses OnPostprocessAllAssets() to detect a files in the project that have a .cuesheet extension. It then runs…
Soviut
  • 88,194
  • 49
  • 192
  • 260
30
votes
4 answers

Load a simple text file in Android Studio

Got a brand new project using Google's new Android Studio IDE. I'm trying to load a simple text file using an InputStreamReader. I'm getting a file not found exception. Now there isn't any assets/ folder. I tried to create one and add my file at…
Yohann T.
  • 1,915
  • 2
  • 23
  • 28
30
votes
2 answers

How to pass a file path which is in assets folder to File(String path)?

Possible Duplicate: Android - How to determine the Absolute path for specific file from Assets? I am trying to pass a file to File(String path) class. Is there a way to find absolute path of the file in assets folder and pass it to File(). I…
akd
  • 6,538
  • 16
  • 70
  • 112
28
votes
4 answers

Android: Accessing images from assets/drawable folders

The app I am currently working on has hundreds of images. At the moment I store them in the 'Drawable' folder. I was thinking about moving all of them to Assets folder. My question is: Is there any difference in performance when using both…
Marqs
  • 17,800
  • 4
  • 30
  • 40
28
votes
3 answers

How to load videos from assets folder? (to play them with VideoView)

I need to open a mp4 video from the assets folder and play it with VideoView. I tryed with these two options, but none of them…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
28
votes
6 answers

How to open a pdf stored either in res/raw or assets folder?

I'm going to show a pdf in my application, and the pdf has to be bundled with the application. What is a good way to do this? I have read that it might be possible to do this by adding the pdf file to a res/raw folder and read it from there, but i…
Ikky
  • 2,826
  • 14
  • 47
  • 68
28
votes
2 answers

Include assets from webpack bundled npm package

I've been banging my head over this for a while, and am wondering if it's even possible to begin with. Thanks for any help with this! The npm package I've got an npm package which is basically a library of React components. This library has embedded…
Johnny Copperstone
  • 773
  • 1
  • 6
  • 14
28
votes
4 answers

Android Assets with sub folders

InputStream myInput = myContext.getAssets().open("MyFolder/" + "MyFile.db3"); I have a file in the assets folder in a sub folder as above. It doesn't get the file though, is there a special way to specify a sub folder in the assets folder? Ian
Ian Vink
  • 66,960
  • 104
  • 341
  • 555