webpacker images folder

4 views
Skip to first unread message

fugee ohu

unread,
Dec 22, 2019, 1:49:57 PM12/22/19
to Ruby on Rails: Talk
If I put in application.js require.context('../images', true) everything works fine regardless of whether I place my images folder under javascripts or under javascripts/packs If I have my image folder under packs and change it to require.context('images', true) it breaks

Ariel Juodziukynas

unread,
Dec 22, 2019, 6:08:08 PM12/22/19
to rubyonra...@googlegroups.com
You shouldn't have files inside pack except for the bundles/packs you'll link on your html, images go in javacsripts/images, not in javascripts/packs. Just read the guide https://github.com/rails/webpacker/blob/master/docs/assets.md#link-in-your-rails-views

El dom., 22 dic. 2019 a las 15:50, fugee ohu (<fuge...@gmail.com>) escribió:
If I put in application.js require.context('../images', true) everything works fine regardless of whether I place my images folder under javascripts or under javascripts/packs If I have my image folder under packs and change it to require.context('images', true) it breaks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/acaa913d-e589-4c10-af28-7488d2777f77%40googlegroups.com.

fugee ohu

unread,
Dec 22, 2019, 6:10:08 PM12/22/19
to Ruby on Rails: Talk


On Sunday, December 22, 2019 at 6:08:08 PM UTC-5, Ariel Juodziukynas wrote:
You shouldn't have files inside pack except for the bundles/packs you'll link on your html, images go in javacsripts/images, not in javascripts/packs. Just read the guide https://github.com/rails/webpacker/blob/master/docs/assets.md#link-in-your-rails-views

El dom., 22 dic. 2019 a las 15:50, fugee ohu (<fuge...@gmail.com>) escribió:
If I put in application.js require.context('../images', true) everything works fine regardless of whether I place my images folder under javascripts or under javascripts/packs If I have my image folder under packs and change it to require.context('images', true) it breaks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.

Actually have all my js files inside packs for now Where should I put those Note: original question was about images

Ariel Juodziukynas

unread,
Dec 22, 2019, 6:14:34 PM12/22/19
to rubyonra...@googlegroups.com

To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4d2ca96e-903e-4182-baea-d6f0f0b815de%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages