Railsは初めてで、最初の壁にぶつかりました。今まで私は答えにグーグルを使うことができました。正直なところ、問題の一部は、問題を適切に説明できないことだと思います。
show.html.erbファイルのMyRailsSelectクエリは、(1)重複レコードを表示し、(2)プレーンテキストではなく奇数形式でデータを表示します。完全に説明するために、以下のすべてのコードを貼り付けます。
has_many:worksのユーザーモデルがあります
class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable
  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me, :first_name, :last_name, :works_attributes
  # attr_accessible :title, :body
  validates_presence_of :first_name, :last_name
  validates_uniqueness_of :first_name, :last_name, :email, :case_sensitive => false
  has_many :works
  accepts_nested_attributes_for :works
これが私の作業モデルで、belongs_to user
class Work < ActiveRecord::Base
  attr_accessible :description, :work_name, :users_id
  belongs_to :user
end
そして、これがユーザーコントローラーです。
class UsersController < ApplicationController
  def index
    @users = User.all
respond_to do |format|
  format.html # index.html.erb
  format.xml  { render :xml => @users }
end
end
  def show
    @user = User.find(params[:id])
    @works = @user.works.all
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @user }
    end
  end
end
ユーザーのshow.html.erbビューで、特定のユーザーに属する作品をループしたいと思います。Railsの規則に従うように、user_idフィールドとの外部キー関係を設定します。ループがユーザーに属する作品を見つけたら、work_nameフィールドを表示したいと思います。
<% if @user.works.any? %>
                    <% @user.works.each do |user| %>
                   <%= @user.works(:select => 'work_name') %>
                  <% end %>
                <% end %>
ただし、これは/ users/1/を表示したときにWebサイトに表示される出力です。
[#<Work id: 1, work_name: "WorkTest1", description: "I am the co-founder and CEO of WorkTest1, a website t...", created_at: "2013-02-12 00:33:19", updated_at: "2013-02-12 00:33:19", user_id: 1>, #<Work id: 2, work_name: "WorkTest2", description: "test", created_at: "2013-02-12 00:33:19", updated_at: "2013-02-12 00:33:19", user_id: 1>] [#<Work id: 1, work_name: "WorkTest1", description: "I am the co-founder and CEO of WorkTest1, a website t...", created_at: "2013-02-12 00:33:19", updated_at: "2013-02-12 00:33:19", user_id: 1>, #<Work id: 2, work_name: "WorkTest2", description: "test", created_at: "2013-02-12 00:33:19", updated_at: "2013-02-12 00:33:19", user_id: 1>]