Trip
Trip

Reputation: 27114

Why am I getting a "wrong number of arguments errors (0 for 1)"?

The Error

wrong number of arguments (0 for 1)

My controller:

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

  render :nothing => true
end

My view:

  .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'

my routes

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

If I remove the text_field_tag, then everything loads. Why would that text_field_tag bomb my app?

Upvotes: 0

Views: 430

Answers (1)

stephenmurdoch
stephenmurdoch

Reputation: 34603

remove the comma from the = text_field_tag, "name" so that you just have:

= text_field_tag "name"

Upvotes: 4

Related Questions