I am using Rails 4 for first time. Documentation says you can pass an instance variable to a partial:
<%= render partial: "customer", object: @new_customer %>
So I try to do the same. I am using fullcalendar engine and I render index.html.erb and inside that I render form partial. I pass @record to partial. I know the record is not nil because I added inspect_record helper to inspect that the @record does exist:
<%= render "form", :object => @record %>
<%= inspect_record @record %>
However, in _form.html.erb partial, the @record is nil, and this condition returns false:
<% unless @record.nil? %>
Note I also tried this:
<%= render 'form', locals: {record: @record} %>
What might I be doing wrong?
@this_onedefined in the controller's action should be available between the action's view and all partial views used.@record