coffeescript or sass) and to compress the assets into a single file (this won’t happen on development).įor these reasons it doesn’t make sense to put the swf file into the asset pipeline. The point of the asset pipeline is two-fold, to allow you to use your preferred syntax (e.g. The reason the swf file is ignored inside of the app/assets/javascripts folder is because there are no registered handlers for swf files (and on that note there shouldn’t be). I read the Action View Overview, Layout and Rendering in Rails, and Working with JavaScript in Rails guides (though I think Klabnik updated some of them yesterday apparently) before and referred back to them during this problem what’s the best way to understand this nuance of the asset pipeline the files in the public folder don’t undergo the asset pipeline process. The folders in thi direcotry I can guess are merely arbitrary containers so I can call it /jakkascript and refer to these folders with no problem? I didn’t see a log abou this happening in the command prompt. Understanding this solution furtherįor educational purposes, why is it that app/assets/javascripts filter out any non-javascript files but not the public/js folder (or any folder in the public/ directory. Thank you senseis, it’s time to kick butt with WebP you’re right about these two files needing to be in the same directory. This has been such a pain in the rear-end for so long. Thanks Chad & Matthew for the & I thank you both I owe you both a lot. Perhaps since teaches the class, he can immediately focus on this rendering issue? I only utilized the “shouter” app for the sake of clarity as a result of the intermediate rails course. js files together rather than group it with another type of file related to it. Īs a result, I cannot use ActionView::Helpers::AssetTagHelper.register_javascript_expansion webpjs: In general, I have issues how to incorporate libraries that have non-js files as a fallback. Considering I tried defer, async, and other javascript tricks, I’ do not know any other alternaties to force the script to execute differently if it was the problem. I’m inclined to say it has something to do with the asset pipeline or the rendering system I’m not understanding. I’ve tested this library on a variety of alternate backend frameworks and languages with no issues (Node.js (Express), Wordpress, and spaghetti PHP) until I tried to utilize it with Rails. webp image to an optimized version of the image typically as a. It’s pretty straightforward what’s going on here: The webpjs library will convert the. In browsers that lack native support for the Webp image format -whether it’s IE6, Firefox, or even the infamous Android browsers–the following should be the output generally to any image that’s a webpjs file on the fly: I’m begun to think whether there’s an implicit expectation for a folder called js these files are stored in being the issue given the asynchronous version I don’t use but is still featured on the website being the following: Unfortunately, I’ve had no luck getting this to work either. and manually inserting the library in the file with the following link directive would work: = javascript_include_tag "webpjs-0.0.2", "data-turbolinks-track" => true Naturally I attempted seeing if the removal of the sprocket directive //= require_tree. What I’ve attempted to do to solve the problem with no luck: Nonetheless, when I attempt to integrate the library in any rails app via the assets/javascripts/ folder, the app doesn’t implement the library correctly (including the shouter app everyone who participated in Thoughtbot’s Intermediate Rails Course created). I’ve been able to even have the library mentioned and verified to be valid to be mentioned on after testing the library on iOS Safary, IE6, IE8 and 10 and Firefox. swf file, in the same directory and attaching both files in the header or footer of the. I’ve been able to verify the library works outside of Rails by merely following the defacto instructions of including the library and its dependency, a. js libraries that require non-js files to be in the same directory in order to work.Īn example of this is the webpjs javascript library which polyfills the ability for the next-generation Webp(Weppy) image format be supported by browsers that don’t natively support it, such as Firefox, desktop and mobile versions safari, and even IE6. The problem is pretty straight forward: I am attempting to implement.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |