I have on change ajax event, that reloads a partial, to build nested attributes, based on the selected item.
The reloaded partial looks like this(I have cut most of it since it is not important):
= f.fields_for :skill_of_objects, @character.skill_of_objects.build do |ff|
%strong
= school_skill.skill.name_pl
= ff.hidden_field :skill_id, value: school_skill.skill.id
= ff.label :value
The problem is the f
builder.
I have done some stack research, and based on the last answer from >> this question I have ended in something like this:
'<%= form_for [current_user, @character] do |f| %>'
$('#school_skills').html("<%= j render( partial: 'school_skills', locals: {f: f}) %>");
'<% end %>'
But I still get error like this:
ActionView::Template::Error (undefined local variable or method `f' for #<#<Class:0xca1eb70>:0xd0811c0>):
Any suggestions would be appreciated :)