I'm using Ruby on Rails 3 to create my web app.
I don't want to create a template file for each tiny partial template so I tried to merge them into one file using `content_for` method but it doesn't works.

My ERB template files are as follows.

layout/\_fragments.html.erb: contains contents of some partial templates

```
<% content_for :twitter_checkbox do -%>
  <% can_post_twitter = current_user && current_user.twitter_oauth %>
  <% label_text = can_post_twitter ? "Post to Twitter" : "Set up your Twitter account" %>
  <%= label_tag :twitter, label_text %>
  <%= check_box_tag :twitter, 0, false, :disabled => !can_post_twitter %>
<%- end %>

<% content_for :other_content_of_partial_template do -%> # content of another partial template
...

```

layouts/application.html.erb

```
<!DOCTYPE html>
<html>
  ...
  <body>
    <%= yield %>
  </body>
</html>
<%= render 'layouts/fragments', :formats => :erb %>

```

layouts/\_form.html.erb

```
<%= form_for(@entry) do |f| %>
  ...
  <%= content_for :twitter_checkbox %> # it shows nothing
<% end %>

```

What is wrong with this way? 
Are there any other better ways to write multiple partial templates into one file?