2011-05-14 68 views
0

的错误为什么我得到“参数错误数量错误(0代表1)”?

wrong number of arguments (0 for 1) 

我的控制器:

def new_topic 
    @new_topic = MeTopic.new(:me_category_id => params[:category]) 

    render :nothing => true 
end 

我的观点:

.new_topic_form 
    - form_tag new_topic_admin_me_categories_path(:category => category.id) do 
     = text_field_tag, "name" 
     %br/ 
     = submit_tag 'Publish', :class => 'button' 

我的路线

admin.resources :me_categories, :collection => {:destroy_topic => :get, :new_topic => :get} 

如果我删除text_field_tag,那么一切都会加载。为什么text_field_tag会轰炸我的应用程序?

+0

您在text_field_tag后有一个逗号。 – daniel 2011-05-14 01:09:11

回答

4

= text_field_tag, "name"删除逗号,这样你只需要:

= text_field_tag "name"

+1

噢,我的天啊..谢谢;) – Trip 2011-05-14 01:08:39

相关问题