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

Fix "Hello Erb" example error #1386

Merged
merged 2 commits into from
Mar 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/install/examples/erb/hello_erb.js.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Run this example by adding <%= javascript_pack_tag 'hello_erb' %> to the head of your layout file,
// like app/views/layouts/application.html.erb.
// Run this example by adding <%%= javascript_pack_tag 'hello_erb' %> to the head of your layout file,
// like app/views/layouts/application.html.erb. Please take care of removing the extra `%` from `<%%=`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO there is no need for that extra line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which line do you mean? This one? // we can't write the correct ERB tags here, they would get interpreted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to Please take care of removing the extra %from<%%=: // we can't write the correct ERB tags here, they would get interpreted.

I assume dev will just copy <%%= javascript_pack_tag 'hello_erb' %> and use it. But that's just an opinion.

cc @gauravtiwari

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, yes but <%%= javascript_pack_tag 'hello_erb' %> doesn't work as it is, you must use <%= javascript_pack_tag 'hello_erb' %>; it's a hint for the user.

// we can't write the correct ERB tags here, they would get interpreted.

<% name = 'Erb' %>

Expand Down