0

Rails 3.0.3 似乎不接受<%= f.text_area :message, :class => "share_ta" %>作为一个有效的声明,并说ActionView::Template::Error (undefined method 'message' for []:Array):

有谁知道为什么?

- 编辑 -

这是form_for

        <%= form_for :activity, :url => post_activity_path do |f| %>
            <div class="share_tb">
                <div class=share_t><span style="margin-left: 10px;">Tell us what's new <span style="color: #1fc2d1;"><%= @user.name %></span></span></div>
                <%= f.text_area :message, :class => "share_ta" %>
            </div>
            <div id=sm_share class=sm_share_rc>
                <ul>
                    <li style="color: #6b6b6b; font-size: 10pt; display: inline; list-style-type: none; float: right; margin-right: 10px; margin-top: 5px;"><%= f.check_box :everyone, "0", :class => "styled" %>Everyone</li>
                    <li style="color: #6b6b6b; font-size: 9pt; display: inline; list-style-type: none; height: 3px; float: left; margin-top: 5px;"><input type="checkbox" name="friends_only" value="3" class="styled">My Friends<br></li>
                </ul>
                 <%= f.submit "Share", :class => "sm_share_b" %>
                </div>
            </div>
        <% end %>
4

1 回答 1

1

@阿米特,

你是如何指定form_for的?

编辑:第二次从原始海报获得更多信息。

它应该是

<%= form_for :activity, :url => acti_path do |f| %>
  <%= f.text_area :message, :class => "share_ta" %>
<% end %>
于 2010-12-29T07:05:40.703 回答