diff options
author | Oscar Del Ben <info@oscardelben.com> | 2012-04-25 15:43:10 +0200 |
---|---|---|
committer | Oscar Del Ben <info@oscardelben.com> | 2012-04-25 15:43:10 +0200 |
commit | ee4e7125a61c703332a8d591a0aee917ba828e62 (patch) | |
tree | ba3fd8f712d3ec262969f54967a908252608547d /guides/code | |
parent | ccbd32c294bf685a389d456164a12fd777756873 (diff) | |
download | rails-ee4e7125a61c703332a8d591a0aee917ba828e62.tar.gz rails-ee4e7125a61c703332a8d591a0aee917ba828e62.tar.bz2 rails-ee4e7125a61c703332a8d591a0aee917ba828e62.zip |
Add partials section to getting started guide
Diffstat (limited to 'guides/code')
-rw-r--r-- | guides/code/getting_started/app/views/posts/_form.html.erb | 2 | ||||
-rw-r--r-- | guides/code/getting_started/config/routes.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/guides/code/getting_started/app/views/posts/_form.html.erb b/guides/code/getting_started/app/views/posts/_form.html.erb index 46ec257b91..b35ea2f237 100644 --- a/guides/code/getting_started/app/views/posts/_form.html.erb +++ b/guides/code/getting_started/app/views/posts/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_for :post, :url => { :action => :update, :id => @post.id }, :method => :put do |f| %> +<%= form_for @post do |f| %> <% if @post.errors.any? %> <div id="errorExplanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> diff --git a/guides/code/getting_started/config/routes.rb b/guides/code/getting_started/config/routes.rb index b0973c62d5..02ca24e95a 100644 --- a/guides/code/getting_started/config/routes.rb +++ b/guides/code/getting_started/config/routes.rb @@ -6,9 +6,9 @@ Blog::Application.routes.draw do get "posts" => "posts#index" get "posts/new" post "posts/create" - get "posts/:id" => "posts#show" + get "posts/:id" => "posts#show", :as => :post get "posts/:id/edit" => "posts#edit" - put "posts/:id/update" => "posts#update" + put "posts/:id" => "posts#update" # The priority is based upon order of creation: # first created -> highest priority. |