Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for webpack_path in ERB templates #100

Closed
MikeRogers0 opened this issue Jul 12, 2020 · 2 comments
Closed

feat: Add support for webpack_path in ERB templates #100

MikeRogers0 opened this issue Jul 12, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@MikeRogers0
Copy link
Contributor

MikeRogers0 commented Jul 12, 2020

Currently if you use ERB to to generate your layouts & call the webpack_path method like:

<script src="<%= webpack_path "js" %>" defer></script>

The user will see the exception:

undefined method `webpack_path' for #<Bridgetown::ERBView:0x000055947211fd08>
noMethodError: undefined method `webpack_path' for #<Bridgetown::ERBView:0x000055947211fd08>
  /usr/local/bundle/bundler/gems/bridgetown-20edf2cb06de/bridgetown-core/lib/bridgetown-core/ruby_template_view.rb:53:in `method_missing'
  /usr/src/app/src/_partials/_head.erb:4:in `__tilt_4320'
  /usr/local/bundle/gems/tilt-2.0.10/lib/tilt/template.rb:170:in `call'
  /usr/local/bundle/gems/tilt-2.0.10/lib/tilt/template.rb:170:in `evaluate'
  /usr/local/bundle/gems/tilt-2.0.10/lib/tilt/template.rb:109:in `render'

Motivation

I'm a big fan of ERB of Liquid as it reminds me more of working with Rails, so ideally I'd prefer to do ERB in my portfolio if possible :)

Guide-level explanation

Reference-level explanation

Drawbacks

Unresolved Questions

We'd have to create a helper separately for ERB, which could be tricky. What is the best approach / where should this be added?

@jaredcwhite jaredcwhite added this to the 0.16.0 "Crystal Springs" milestone Jul 12, 2020
@jaredcwhite jaredcwhite added the bug Something isn't working label Jul 12, 2020
@jaredcwhite jaredcwhite self-assigned this Jul 12, 2020
@jaredcwhite
Copy link
Member

Should merge in #96 first…

@jaredcwhite
Copy link
Member

Fixed in #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants