From d7154d483269fc25d771d5b8b7b8a2c889e4b3f5 Mon Sep 17 00:00:00 2001 From: James Gifford Date: Mon, 12 Sep 2011 10:30:45 -0400 Subject: Added getting_started code, updated guide with link to rails github repo and path to code --- .../getting_started/app/views/posts/_form.html.erb | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 railties/guides/code/getting_started/app/views/posts/_form.html.erb (limited to 'railties/guides/code/getting_started/app/views/posts/_form.html.erb') diff --git a/railties/guides/code/getting_started/app/views/posts/_form.html.erb b/railties/guides/code/getting_started/app/views/posts/_form.html.erb new file mode 100644 index 0000000000..e27da7f413 --- /dev/null +++ b/railties/guides/code/getting_started/app/views/posts/_form.html.erb @@ -0,0 +1,32 @@ +<% @post.tags.build %> +<%= form_for(@post) do |post_form| %> + <% if @post.errors.any? %> +
+

<%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:

+ +
+ <% end %> + +
+ <%= post_form.label :name %>
+ <%= post_form.text_field :name %> +
+
+ <%= post_form.label :title %>
+ <%= post_form.text_field :title %> +
+
+ <%= post_form.label :content %>
+ <%= post_form.text_area :content %> +
+

Tags

+ <%= render :partial => 'tags/form', + :locals => {:form => post_form} %> +
+ <%= post_form.submit %> +
+<% end %> -- cgit v1.2.3