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

ERB in line comments break template rendering e.g. <% # comment %> #113

Open
huoxito opened this issue Sep 21, 2013 · 2 comments
Open

ERB in line comments break template rendering e.g. <% # comment %> #113

huoxito opened this issue Sep 21, 2013 · 2 comments

Comments

@huoxito
Copy link
Member

huoxito commented Sep 21, 2013

I was investigating some failures in spree_i18n build and tracked it down to deface overrides. For some reason every time we try to override something in a template, which has erb inline comments, with deface the rendering process breaks.

To reproduce you can place a partial like this in a fresh Spree 2.1 app:

app/views/spree/shared/_nav_bar.html.erb (this is overridden in spree_auth_devise)

<nav id="top-nav-bar" class="columns ten">
  <ul id="nav-bar" class="inline" data-hook>
    <li id="search-bar" data-hook>
      <% # comment %>
      <%= render :partial => 'spree/shared/search' %>
    </li>
  </ul>
</nav>

You should get a very confusing SyntaxError. The same code doesn't generate any error in Spree 2.0.x (which runs Rails 3.2.x). I'm on ruby 2.0.0. Applying the comment like this however <%# comment %> doesn't error.

Curious to know if you guys have any clue on what's happening here?

@sbounmy
Copy link

sbounmy commented Sep 25, 2013

@rounders
Copy link

I encounter this same issue in 1-3-stable which uses deface 1.0.0 when I try to use deface to make a change to spree/admin/payment_methods/_form.html.erb because that view has an inline comment.

additional info:
i'm using Rails 3.2.14, and ruby 1.9.3p393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants