Q:

How to pass a parameter from a partial layout to a partial?

I want to display a form partial within a shared partial layout form_layout
# views/layouts/shared/_form_layout.html.haml
= form_with(model: record, remote: true) do |form|
  .fields
    = yield
/// other stuff

# views/articles/_form.html.haml
# ?? want to access the form builder here

# views/articles/new.html.haml
= render partial: 'form', layout: 'layouts/shared/form_layout', locals: { record: Article.new }

How can I access the FormBuilder object inside the partial template?

A:

You should try this-
= render layout: "layouts/shared/form_layout", locals: { record: Article.new} do
  # block contents..

