我现在正试图在他或她的“我的页面”上显示用户已经注册的图像。然后,我写了一些代码如下。但它不起作用。你能给我一些建议吗?
☆members_controller
@member= Member.find(params[:id])
@member.groups.reverse.map do |group|
@join_groups_images = group.imageurl
☆(会员)show.html.erb
<div class="join_groups_images">
<%= image_tag @join_groups_images, :width => '20px' ,:height => '25px' %>
</div>
☆(model)member.rb
class Member < ActiveRecord::Base
attr_accessible :admin, :mail, :memo, :name, :pass, :user, :pass_confirmation
has_many :group_in_members, :dependent => :destroy
has_many :groups, :through => :group_in_members
☆(模型)group_in_member.rb
class GroupInMember < ActiveRecord::Base
attr_accessible :group_id, :member_id
belongs_to :group
belongs_to :member
end
☆schema.rb
create_table "groups", :force => true do |t|
t.string "name"
t.text "memo"
t.boolean "admin"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "imageurl"
end