Comments (7)
@rymohr thanks for the links, I have a question about using ActionView helpers...
How can I have Gulp tasks build up assets and dump them into ./public/assets while being able to use helpers? I have, for example with html files, been using gulp-ruby-haml which allows me to use Ruby, but no helper methods are accessible.. Would love to be able to precompile html locally and in the preprocessing be able to use helpers.
Am I going in the right direction?
from gulp-rails-pipeline.
Sorry @audeamus22 I haven't actually started using this library yet. Maybe @greypants can help.
from gulp-rails-pipeline.
Ok thank you, any suggestions @greypants ?
from gulp-rails-pipeline.
Hmm... I guess it could make sense to just add gulp/assets as the first directory searched, then fallback to the old asset pipeline directories (`app/assets, 'vendor/assets', etc). I'll definitely look into it (or feel free to open a pull request)
@audeamus22 Not sure about gulp-ruby-haml
- this setup continues to use Rails views for markup, and the gulp_asset_path
helper is available to them, and you can use that with regular html for now.
haml
%img{src => gulp_asset_path('images/foo.png')}
erb
<img src="<%= gulp_asset_path('images/foo.png') %>" >
from gulp-rails-pipeline.
Thank you @greypants, I have gotten the gulp_asset_path working great when implemented through Rails views markup. I am presented with the following challenge and can't seem to figure it out:
I am using a client framework (Auriela / Durandal to be specific). This framework has not supported the use of javascript function templates that can be accessed and re-used client side. Also, this framework uses module ids to fetch from the server specific html files, such as:
/assets/javascripts/common/main_nav/main_nav.html
Aurelia / Durandal expects an html file response.
Knowing how there are gems to output js templates ( such as this one: https://github.com/dnagir/ruby-haml-js ), the ability to use these gems to configure the assets:precompile build works. These configurations allow for the client to tap into whatever logic Rails and the ActionView helpers can provide --- all through a global JST function spit out by the gem. link_to, form_for, gulp_asset_path all can work inside these *.jst.hamljs files.
I'm looking for a way to take your gulp task setup and modify it so I can tap into link_to, form_for, gulp_asset_path, and be able to generate html files that are dumped to ./public/assets/javascripts/**/*.html
. Or alternatively, if it is not possible to run a gulp task to do this, is there a way to get Rails to serve these .html files back on getting requests from Aurelia / Durandal? And if Rails is able to serve these .html files, does that mean I would have to set config.assets.compile = true
in production.rb config?
I really appreciate your help, thank you.
from gulp-rails-pipeline.
@greypants was going to open a PR but wanted to make sure I didn't break anything. Did I miss something or is there no test suite?
from gulp-rails-pipeline.
Wild west. No test suite yet. 😨
I'll open an issue to add one.
from gulp-rails-pipeline.
Related Issues (20)
- images do not load HOT 2
- Heroku - Couldn't find the file 'global' HOT 1
- npm install fails HOT 3
- Rails 4.2.1 + Sprockets 3.0.2 breaks browserSync HOT 7
- Assets not updating on Heroku HOT 1
- Access sass mixins defined in gems HOT 1
- Require JS files similar to require_tree HOT 3
- Sass change does not call browserSync but browserify change does HOT 4
- Issue after upgrading to rails 4.2.3 and ruby 2.2.2
- Not manifesting/versioning CSS & JS HOT 7
- Icon fonts not working HOT 1
- Fails to build on heroku HOT 4
- RAILS_ENV=production rake assets:precompile fails locally HOT 1
- Having trouble deploying to Heroku HOT 3
- Can't redeploy to Heroku HOT 1
- Not compatible with Puma HOT 1
- Use gulp_asset_path in scss HOT 1
- No sass or coffee watch
- Navigation with turbolinks results in a white page with browserSync
- Doesn't compile image-url sprockets helper HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-rails-pipeline.