diff options
author | Xavier Noria <fxn@hashref.com> | 2011-09-12 07:49:36 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-09-12 07:49:36 -0700 |
commit | 63082af306b3da34a5c888d19eef7314a4ef06e6 (patch) | |
tree | 903afe48e0393578c54b42d050a85f8770e93121 /railties/guides/code/getting_started/app/views/posts/_form.html.erb | |
parent | 4bcacc80667a548664b5ca09d85074c6c383748e (diff) | |
parent | d7154d483269fc25d771d5b8b7b8a2c889e4b3f5 (diff) | |
download | rails-63082af306b3da34a5c888d19eef7314a4ef06e6.tar.gz rails-63082af306b3da34a5c888d19eef7314a4ef06e6.tar.bz2 rails-63082af306b3da34a5c888d19eef7314a4ef06e6.zip |
Merge pull request #2984 from jrgifford/master
Added getting_started application to railties/guides/code/getting_started
Diffstat (limited to 'railties/guides/code/getting_started/app/views/posts/_form.html.erb')
-rw-r--r-- | railties/guides/code/getting_started/app/views/posts/_form.html.erb | 32 |
1 files changed, 32 insertions, 0 deletions
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? %> + <div id="errorExplanation"> + <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> + <ul> + <% @post.errors.full_messages.each do |msg| %> + <li><%= msg %></li> + <% end %> + </ul> + </div> + <% end %> + + <div class="field"> + <%= post_form.label :name %><br /> + <%= post_form.text_field :name %> + </div> + <div class="field"> + <%= post_form.label :title %><br /> + <%= post_form.text_field :title %> + </div> + <div class="field"> + <%= post_form.label :content %><br /> + <%= post_form.text_area :content %> + </div> + <h2>Tags</h2> + <%= render :partial => 'tags/form', + :locals => {:form => post_form} %> + <div class="actions"> + <%= post_form.submit %> + </div> +<% end %> |