diff options
author | Oscar Del Ben <info@oscardelben.com> | 2012-04-20 10:47:38 +0200 |
---|---|---|
committer | Oscar Del Ben <info@oscardelben.com> | 2012-04-20 10:47:38 +0200 |
commit | dbb4c4ddb601e06fef37f63d644a5297f3292c2a (patch) | |
tree | ae5dcd02671dbc8ec3a5b36b444ce99777253a0e /guides/code/getting_started/app | |
parent | f6d5036dd620da48624ce32494f63aa4221b05d5 (diff) | |
download | rails-dbb4c4ddb601e06fef37f63d644a5297f3292c2a.tar.gz rails-dbb4c4ddb601e06fef37f63d644a5297f3292c2a.tar.bz2 rails-dbb4c4ddb601e06fef37f63d644a5297f3292c2a.zip |
New Getting started guide wont have tags
Diffstat (limited to 'guides/code/getting_started/app')
5 files changed, 1 insertions, 25 deletions
diff --git a/guides/code/getting_started/app/helpers/posts_helper.rb b/guides/code/getting_started/app/helpers/posts_helper.rb index b6e8e67894..a7b8cec898 100644 --- a/guides/code/getting_started/app/helpers/posts_helper.rb +++ b/guides/code/getting_started/app/helpers/posts_helper.rb @@ -1,5 +1,2 @@ module PostsHelper - def join_tags(post) - post.tags.map { |t| t.name }.join(", ") - end end diff --git a/guides/code/getting_started/app/models/post.rb b/guides/code/getting_started/app/models/post.rb index 4b809110b6..e77e607f3f 100644 --- a/guides/code/getting_started/app/models/post.rb +++ b/guides/code/getting_started/app/models/post.rb @@ -3,7 +3,6 @@ class Post < ActiveRecord::Base :length => { :minimum => 5 } has_many :comments, :dependent => :destroy - has_many :tags accepts_nested_attributes_for :tags, :allow_destroy => :true, :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } } diff --git a/guides/code/getting_started/app/models/tag.rb b/guides/code/getting_started/app/models/tag.rb deleted file mode 100644 index 30992e8ba9..0000000000 --- a/guides/code/getting_started/app/models/tag.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Tag < ActiveRecord::Base - belongs_to :post -end 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 da78a9527b..3445fd8779 100644 --- a/guides/code/getting_started/app/views/posts/show.html.erb +++ b/guides/code/getting_started/app/views/posts/show.html.erb @@ -14,12 +14,7 @@ <b>Content:</b> <%= @post.content %> </p> - -<p> - <b>Tags:</b> - <%= join_tags(@post) %> -</p> - + <h2>Comments</h2> <%= render @post.comments %> diff --git a/guides/code/getting_started/app/views/tags/_form.html.erb b/guides/code/getting_started/app/views/tags/_form.html.erb deleted file mode 100644 index 7e424b0e20..0000000000 --- a/guides/code/getting_started/app/views/tags/_form.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= form.fields_for :tags do |tag_form| %> - <div class="field"> - <%= tag_form.label :name, 'Tag:' %> - <%= tag_form.text_field :name %> - </div> - <% unless tag_form.object.nil? || tag_form.object.new_record? %> - <div class="field"> - <%= tag_form.label :_destroy, 'Remove:' %> - <%= tag_form.check_box :_destroy %> - </div> - <% end %> -<% end %> |