From eb5c2484a9e3f4966dbad7da7096aefff5e363c4 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Tue, 26 Nov 2019 15:27:19 -0600 Subject: [PATCH] Remove a useless variable assignment We can shortcut the assignment that was in the partial by naming the object directly. --- app/views/shared/_add_new_item_form.html.erb | 4 ++-- app/views/todos/_new_multi_todo_form.html.erb | 2 -- app/views/todos/_new_todo_form.html.erb | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/views/shared/_add_new_item_form.html.erb b/app/views/shared/_add_new_item_form.html.erb index e592540a..42a33364 100644 --- a/app/views/shared/_add_new_item_form.html.erb +++ b/app/views/shared/_add_new_item_form.html.erb @@ -14,7 +14,7 @@ <%= t('shared.toggle_multi') %> - <%= render :partial => 'todos/new_todo_form', :object => Todo.new %> - <%= render :partial => 'todos/new_multi_todo_form', :object => Todo.new %> + <%= render :partial => 'todos/new_todo_form', :locals => {todo: Todo.new} %> + <%= render :partial => 'todos/new_multi_todo_form', :locals => {todo: Todo.new} %> diff --git a/app/views/todos/_new_multi_todo_form.html.erb b/app/views/todos/_new_multi_todo_form.html.erb index 1e30579a..7a5be642 100644 --- a/app/views/todos/_new_multi_todo_form.html.erb +++ b/app/views/todos/_new_multi_todo_form.html.erb @@ -1,5 +1,3 @@ -<%- todo = new_multi_todo_form -%> -