I am a super newbie to rails but I am defining a local variable (a css class) and passing it to this partial
render(partial: 'calendar_inventory', locals:{klass: params[:select]})
Inside my partial I have a pagination occurring:
<div class="grid-container" data-calendar-target="grid" data-action= "scroll->calendar#populateHeader">
<%= turbo_frame_tag "paginate_page_#{@sub_orders.current_page}" do %>
<%@sub_orders.each do |sub| %>
<%="klass:"+klass%>
<%end%>
<% if @sub_orders.next_page %>
<%= turbo_frame_tag "paginate_page_#{@sub_orders.next_page}", src: filter_supplier_calendars_path(page: @sub_orders.next_page), loading: 'lazy' do %>
Loading...
<% end %>
<%end%>
</div>
<% end %>
<%end%>
Trying to paginate some orders here, the initial loading of the klass is found however when I paginate is does not keep the value of klass and therefore doesn't display anything.
I've tried adding locals:{klass: params[:select]}
to where the next_page is being appended but it just adds a data-variable of locals="klass" inside the tag itself
Any ideas on how I can pass this klass variable into the turbo frame?