% if @object.persisted? %>
<%= simple_nested_form_for @object, url: @form_action_url, method: :post do |f| %>
<%= f.input :title %>
<%= f.input :path %>
<%= f.input :template_name, collection: page_templates, include_blank: false %>
<%= f.input :hidden, as: :hidden %>
<% end %>
<%= render partial: @object.template_path %>
<% else %>
<%= simple_form_for @object, url: @form_action_url do |f| %>
<%= f.input :title %>
<%= f.input :path %>
<%= f.input :template_name, collection: page_templates, include_blank: false %>
<%= f.input :hidden, as: :hidden %>
<% end %>
<% end %>