From 30e65c50d89bf736d784ed58d39eec35ae860a55 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 4 Dec 2007 06:03:13 +0000 Subject: [PATCH] people forms git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@54 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/views/peoples/_people_form.rhtml | 4 ++++ app/views/peoples/edit.rhtml | 8 +++++--- app/views/peoples/index.rhtml | 2 +- app/views/peoples/new.rhtml | 5 +---- 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 app/views/peoples/_people_form.rhtml diff --git a/app/views/peoples/_people_form.rhtml b/app/views/peoples/_people_form.rhtml new file mode 100644 index 0000000..9651bda --- /dev/null +++ b/app/views/peoples/_people_form.rhtml @@ -0,0 +1,4 @@ +

+ <%= text_field 'people', 'title' %> +

+<%= render :partial => 'pages/page_form' %> diff --git a/app/views/peoples/edit.rhtml b/app/views/peoples/edit.rhtml index e7af0a6..004541c 100644 --- a/app/views/peoples/edit.rhtml +++ b/app/views/peoples/edit.rhtml @@ -1,10 +1,12 @@ <%= error_messages_for :people %> -<% form_for(:people, :url => people_path(@people), :html => { :method => :put }) do |f| %> +<% form_for(:people, :url => people_path(@people.page.title_for_url), :html => { :method => :put }) do |f| %> + <%= render :partial => 'people_form' %>

<%= submit_tag "Update" %>

<% end %> -<%= link_to 'Show', people_path(@people) %> | -<%= link_to 'Back', peoples_path %> \ No newline at end of file +<% content_for :sidebar do -%> + <%= show_people_link(@people) %>
+<% end -%> \ No newline at end of file diff --git a/app/views/peoples/index.rhtml b/app/views/peoples/index.rhtml index d1c5b9f..4de464e 100644 --- a/app/views/peoples/index.rhtml +++ b/app/views/peoples/index.rhtml @@ -9,6 +9,6 @@ <%= render :partial => 'shared/pagination_links' %> <% content_for :sidebar do -%> - <%= link_to 'Create a new person', new_people_path %>
+ <%= new_people_link %>
<%= render :partial => 'shared/tag_cloud' %> <% end -%> \ No newline at end of file diff --git a/app/views/peoples/new.rhtml b/app/views/peoples/new.rhtml index 0b2b07b..edb8f69 100644 --- a/app/views/peoples/new.rhtml +++ b/app/views/peoples/new.rhtml @@ -1,11 +1,8 @@ -

New people

- <%= error_messages_for :people %> <% form_for(:people, :url => peoples_path) do |f| %> + <%= render :partial => 'people_form' %>

<%= submit_tag "Create" %>

<% end %> - -<%= link_to 'Back', peoples_path %> \ No newline at end of file