<%= render 'form', project: @project, button_name: 'Create' %>
You can use the passed in variable in the form partial like this:
<%= form_for(project) do |f| %>
<% if project.errors.any? %>
<%= pluralize(project.errors.count, "error") %> prohibited this project from being saved:
- <%= message %>
<% project.errors.full_messages.each do |message| %>
<% end %>
<% end %>
<% if params[:preview_button] %>
<%= project.description %>
<% end %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :description %>
<%= f.text_area :description %>
<%= f.submit button_name %>
<%= f.submit 'Preview', name: 'preview_button' %>
<% end %>