diff options
author | Oscar Del Ben <info@oscardelben.com> | 2012-04-20 12:53:18 +0200 |
---|---|---|
committer | Oscar Del Ben <info@oscardelben.com> | 2012-04-20 12:53:18 +0200 |
commit | e7e72aa253d9cb3bef786a955794986d1f3ff871 (patch) | |
tree | 85d7b3c6f1d2ac3f6928e695a0032332cda641a5 /guides/code/getting_started/app/views/posts | |
parent | 2e2afc0ac64190261df4b05428afddea96c8628c (diff) | |
download | rails-e7e72aa253d9cb3bef786a955794986d1f3ff871.tar.gz rails-e7e72aa253d9cb3bef786a955794986d1f3ff871.tar.bz2 rails-e7e72aa253d9cb3bef786a955794986d1f3ff871.zip |
Add index and links section to Getting started guide
Diffstat (limited to 'guides/code/getting_started/app/views/posts')
3 files changed, 8 insertions, 14 deletions
diff --git a/guides/code/getting_started/app/views/posts/index.html.erb b/guides/code/getting_started/app/views/posts/index.html.erb index 45dee1b25f..455a74b17f 100644 --- a/guides/code/getting_started/app/views/posts/index.html.erb +++ b/guides/code/getting_started/app/views/posts/index.html.erb @@ -1,27 +1,19 @@ <h1>Listing posts</h1> +<%= link_to 'New post', :action => :new %> + <table> <tr> - <th>Name</th> <th>Title</th> - <th>Content</th> - <th></th> - <th></th> + <th>Text</th> <th></th> </tr> <% @posts.each do |post| %> <tr> - <td><%= post.name %></td> <td><%= post.title %></td> - <td><%= post.content %></td> - <td><%= link_to 'Show', post %></td> - <td><%= link_to 'Edit', edit_post_path(post) %></td> - <td><%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %></td> + <td><%= post.text %></td> + <td><%= link_to 'Show', :action => :show, :id => post.id %> </tr> <% end %> </table> - -<br /> - -<%= link_to 'New Post', new_post_path %> diff --git a/guides/code/getting_started/app/views/posts/new.html.erb b/guides/code/getting_started/app/views/posts/new.html.erb index 5d6482f880..ce9523a721 100644 --- a/guides/code/getting_started/app/views/posts/new.html.erb +++ b/guides/code/getting_started/app/views/posts/new.html.erb @@ -2,4 +2,4 @@ <%= render 'form' %> -<%#= link_to 'Back', posts_path %> +<%= link_to 'Back', :action => :index %> diff --git a/guides/code/getting_started/app/views/posts/show.html.erb b/guides/code/getting_started/app/views/posts/show.html.erb index 6207babdf0..a79fadfe4c 100644 --- a/guides/code/getting_started/app/views/posts/show.html.erb +++ b/guides/code/getting_started/app/views/posts/show.html.erb @@ -7,3 +7,5 @@ <strong>Text:</strong> <%= @post.text %> </p> + +<%= link_to 'Back', :action => :index %> |