-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
parse error on value ")" (tRPAREN) on Rails ERb files #82
Comments
any chance you can provide me with a file or fragment that can reproduce your issue? |
One example: <% title('page title') %>
<%= form_for(@thing) do |f| %>
<%= f.error_messages(class: 'error') %>
(omitting further form stuff)
<% end %> And the error/warning comes out on the line with the My impression was that it's happening on all our pages, but perhaps it's only happening on forms. It's just that the majority of pages do contain forms, because of filters and the like. |
Ah. That's not valid ERB. The Generic example:
vs
|
Is this also invalid ERB? https://apidock.com/rails/ActionView/Helpers/FormHelper/form_for <%= form_for :person do |f| %>
First name: <%= f.text_field :first_name %><br />
Last name : <%= f.text_field :last_name %><br />
Biography : <%= f.text_area :biography %><br />
Admin? : <%= f.check_box :admin %><br />
<%= f.submit %>
<% end %> Also, the application itself runs and passes all tests... so it's just flay as far as I can tell, and nobody else has issues with it. Going through the history for the Also if I remove the '=', I just get no output. This makes perfect sense, because the '=' is what indicated that it should output. :( |
Yes:
_buf = ::String.new; _buf << ( form_for :person do |f| ).to_s; _buf << '
'.freeze; _buf << ' First name: '.freeze; _buf << ( f.text_field :first_name ).to_s; _buf << '<br />
Last name : '.freeze; _buf << ( f.text_field :last_name ).to_s; _buf << '<br />
Biography : '.freeze; _buf << ( f.text_area :biography ).to_s; _buf << '<br />
Admin? : '.freeze; _buf << ( f.check_box :admin ).to_s; _buf << '<br />
'.freeze; _buf << ( f.submit ).to_s; _buf << '
'.freeze; end
_buf << '
'.freeze;
_buf.to_s looks like there's a special form for it: https://github.com/jeremyevans/erubi#capturing- ETA: buuuut that special form requires me to switch the Engine instantiated, so it won't currently work. |
Right, so I gather flay-actionpack exists specifically to use Rails' ERB parser instead of the Ruby one when processing ERB. What happens on my machine is, flay loads flay-actionpack's plugin file first, then after it, loads its own one and replaces the It seems like this happens in some arbitrary order. It might be based on LOAD_PATH but it doesn't match the order gems are specified in the Gemfile... I think the only way I'm getting this to work is if there were some way to remove the default erb plugin. |
You can use a
CC @hakanai |
This is fixed |
Running flay (as part of metrics_fu), I get errors parsing ERb files some time around updating to Ruby 3.0.
It seems like a minor issue because it continues to run and finishes without an outright failure, but we have a lot of views so the log gets flooded heavily with these errors.
I have tried also including flay-actionpack in case that fixed the issue, but no, I still get the errors despite having that gem installed as well.
The text was updated successfully, but these errors were encountered: