Neologis
Neologis

Reputation: 157

Refactoring ERB to HAML - Ruby code inside ruby code in one line


I have a small question and don't have any idea how to deal with my problem.
I was looking for answer to question but I didn't find anything.

I want to refactor erb to haml.
My question is - how to refactor part of code like this (ruby code inside ruby code in one line):

<%%= render partial: '<%= singular_table_name %>', collection: @<%= plural_table_name %>, locals: {f: f} %>

http://html2haml.com answer is:

<%= render partial: '<%= singular_table_name %>', collection: @#{plural_table_name}, locals: {f: f} %>

But I don't think that's good idea...

Upvotes: 0

Views: 81

Answers (1)

Joel Brewer
Joel Brewer

Reputation: 1652

= render partial: singular_table_name, collection: @plural_table_name, locals: {f: f}

Upvotes: 1

Related Questions