开发者

rails seems to have a problem with text_area

开发者 https://www.devze.com 2023-02-01 07:36 出处:网络
Rails 3.0.3 does not seems to accept <%= f.text_area :message, :class => \"share_ta\" %> as a valid statement, and says ActionView::Template::Error (undefined method \'message\' for []:Array)

Rails 3.0.3 does not seems to accept <%= f.text_area :message, :class => "share_ta" %> as a valid statement, and says ActionView::Template::Error (undefined method 'message' for []:Array):

Does anyone know why?

--Edit--

This is the 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开发者_如何学Go></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 %>


@Amit,

How have you specified form_for?

EDIT: 2nd time with more information from original poster.

It should be

<%= form_for :activity, :url => acti_path do |f| %>
  <%= f.text_area :message, :class => "share_ta" %>
<% end %>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号