rails-assets

image_url gives different result when run from controller?

﹥>﹥吖頭↗ 提交于 2021-02-08 12:10:19
问题 The problem This code: image_url('my_image.png') generates this url from within the view : http://localhost:3000/assets/my_image-d229e5de55e4f8589c78e2419221fa3ae4f9d4026f.png But when the same code is run from the controller , it generates this: http://localhost:3000/images/my_image.png Only the first url actually works. How can I generate the correct url (the one containing the fingerprint) from the controller? What I tried I found a way to make it work locally, by generating the digest

Rails Asset Pipeline problems with jquery-ui

为君一笑 提交于 2019-12-25 09:00:54
问题 Update I downloaded the latest version of jquery 3.1 and jquery-ui from the jquery website. Unluckly this problem with the .effect() function is not connected to the asset pipeline. I had all the required js and css files included, but .effect() would not work. This problem is only related to Jquery-ui, while jquery methods work fine. I am giving up on this, doing a git checkout and I will not use Jquery-ui effects for now. Summary My asset pipeline was working fine, but as I wanted to use

Rails 5 problems with multiple manifest files

丶灬走出姿态 提交于 2019-12-24 08:26:25
问题 thanks for your help. My Problem In my Rails 5 application I have 2 layouts, for this reason I need to set up multiple manifest files. What I have done I did the following: The two layouts have a user.html.erb and a main.html.erb html file, there I linked with the correct tags my application.js in user.html.erb and my main.js for main.html.erb . The file loads, if I follow localhost:3000/assets/application.js the full content of the js files included in the manifest is displayed, while at

How to call react-modal from rails-assets.org in react-rails component

一笑奈何 提交于 2019-12-12 16:32:54
问题 I have a rails app that uses react on the front end but I'm having trouble adding other react modules to my components. I am using react-rails for incorporating react into my rails app. I would like to add react-modal to a component. I've used rails-assets to add react-modal as a gem but I'm having trouble calling react-modal in my component. I was hoping it would be a similiar call as React.DOM but that hasn't seemed to be the case. I can't use the normal 'require()' syntax due to sprockets

Rails - Rails.root.join misbehaving after deployment

青春壹個敷衍的年華 提交于 2019-12-01 09:47:55
I have, in my app/assets directory, the directories javascripts and stylesheets, as any normal Rails app. I wanted, however, to have a plugins directory as well. Example: app/assets/plugins/myPlugin1/somefile.js app/assets/plugins/myPlugin1/somefile.css Thing is, if I use <%= javascript_include_tag 'plugins/myPlugin1/somefile.js' %> I would get a 404 error, as /assets/javascripts/plugins/myPlugin1/somefile.js does not exist. I noticed, then, that "plugins" dir was trying to be accessed inside javascripts. I assume this have something to do with "javascript_include_tag". After some research, I

Rails - Rails.root.join misbehaving after deployment

孤街浪徒 提交于 2019-12-01 09:15:07
问题 I have, in my app/assets directory, the directories javascripts and stylesheets, as any normal Rails app. I wanted, however, to have a plugins directory as well. Example: app/assets/plugins/myPlugin1/somefile.js app/assets/plugins/myPlugin1/somefile.css Thing is, if I use <%= javascript_include_tag 'plugins/myPlugin1/somefile.js' %> I would get a 404 error, as /assets/javascripts/plugins/myPlugin1/somefile.js does not exist. I noticed, then, that "plugins" dir was trying to be accessed inside