From 2ed6806e6e3e08c94452a99e5b907d84135bbd6d Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 10 Aug 2011 22:54:10 -0400 Subject: [PATCH] breaking out into a partial view --- .../015/hodgepodge/app/views/list/_new_item_form.html.erb | 4 ++++ .../015/hodgepodge/app/views/list/shopping_list.html.erb | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 cookbook/015/hodgepodge/app/views/list/_new_item_form.html.erb diff --git a/cookbook/015/hodgepodge/app/views/list/_new_item_form.html.erb b/cookbook/015/hodgepodge/app/views/list/_new_item_form.html.erb new file mode 100644 index 0000000..6337696 --- /dev/null +++ b/cookbook/015/hodgepodge/app/views/list/_new_item_form.html.erb @@ -0,0 +1,4 @@ +<%= form_tag :action => 'new' do %> + Item: <%= text_field "item", "value" %> + <%= submit_tag "Add new item" %> +<% end %> diff --git a/cookbook/015/hodgepodge/app/views/list/shopping_list.html.erb b/cookbook/015/hodgepodge/app/views/list/shopping_list.html.erb index b28181b..ae9d336 100644 --- a/cookbook/015/hodgepodge/app/views/list/shopping_list.html.erb +++ b/cookbook/015/hodgepodge/app/views/list/shopping_list.html.erb @@ -8,9 +8,4 @@ <% end %> -

Add new item

- -<%= form_tag :action => 'new' do %> - <%= text_field "product", "name" %> - <%= submit_tag "Add new item" %> -<% end %> +<%= render :partial => 'new_item_form' %>