I'm working on a Ruby on Rails project and I'm working on a module (Financial) it's linked to several models, and depending on the screen the user is able to do it bring a screen with all the financial movements of that object. However I wanted to do only a partial, in the partial I would pass a variable (taken via metaprogramming) to a given field (also get via meta programming)
To try to generate the link I'm doing this:
<%%= link_to new_financial_path(<%= singular_table_name %>_id: @<%= singular_table_name %>.id), class: 'btn btn-primary pull-right', remote: true do %>
<span class="fa fa-plus"></span>
<%= I18n.t('financials.new.new') %>
<%% end %>
But the system is returning
NoMethodError - undefined method 'singular_table_name' for #<#<Class:0x007ff098434898>:0x007ff0b5c02eb8>
Did you mean? singleton_method: app / views / financials / _financials.html.erb: 2: in '_app_views_financials__financials_html_erb