Replies: 1 comment
-
One option is to "comment" out the erb lines. The erb expressions still get evaluated, it just makes them invisible to the yaml parser. # <% 30.times do |n| %>
user_<%= n %>:
name: <%= "User #{n}" %>
email: <%= "user-#{n}@example.com" %>
password_digest: <%= User.digest('password') %>
activated: true
activated_at: <%= Time.zone.now %>
# <% end %> I don't love it though, it makes it very easy to skip over the erb lines when reading. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a Rails app and in my user.yml fixture lines 1 and 8 of the following code are highlighted as errors even though it is valid ERB. Is there a way to have the YAML validator overlook ERB without turning off validations completely?
For reference the error for the first line is
Implicit keys need to be on a single line
and the error for the second line isImplicit map keys need to be followed by map values
.Beta Was this translation helpful? Give feedback.
All reactions