I would appreciate it if someone could help me with the following issue.
I have in my form the following code:
Type: <%= f.select(:SUB_TYPE, [
['type A', 'type A'],
['type B', 'type B'],
['Type C', 'type C']
],{ :prompt => "Please select"}
) %>
<% f.fields_for :author do |builder| %>
<%= render :partial=>'sub/formAuthor', :locals => {:f => builder, :sub_type_selected => value_of_selected_type} %>
<% end %>
I need to pass the type selected by the user to the partial 'formAuthor' and I would like to do so by passing the selected type value via the variable ':sub_type_selected'.
My question is how do I pass the value of the selected type to that partial.
Any suggestion is most appreciated.