错误的参数数量(2为1)

时间:2012-06-06 09:59:53

标签: ruby-on-rails-3

这是什么错误? BrandsController#index中的ArgumentError 错误的参数数量(2为1) 我在控制器中索引的代码是:

  def index
    @brands = Brand.all
    #@brands = Brand.paginate :page => params[:page],:per_page => 6 
    respond_to do |format|
      format.html
      format.xml { render :xml => @brands.to_xml }
    end
  end 

我查看index.html.haml的代码是:

- content_for :title do
  Listing Brands
- content_for :div do
  Listing Brands
- content_for :subnav do
  #navigation-search
    /= yield :brand_img
    %img{:src => "images/lifestyle.gif", :height => "35"}
    /= link_to 'Change Brand', new_brand_path
    %a.Metro-16{:href => new_brand_path, :title => "Change brand"} Change Brand   
  = render :partial => 'updatemesg'

- content_for :brand_img do 
  %img{:src => "images/lifestyle.gif", :height => "35"}
-#
  - content_for :subnav do
    #navigation-search
      %form
        #{yield :brand_img}

  %ul
    %li
      %a.tt-top-center{:title => "Total Events"}#{Event.all.size}
      %span Total events
    %li
      %a.blue.tt-top-center{:title => "Today's Events"} 12
      %span Today's Events
    %li
      %a.green.tt-top-center{:title => "Tomorrow's Events"} 3
      %span Tomorrow's Events
    %li
      %a.tt-top-center{:title => "Upcoming Events"} 7
      %span Upcoming Events

  %a#show-modal.create-24.tt-top-center{:href => new_brand_path, :title => "New Brand"} New Brand

- @brands.each do |brand|
  .ovr
    %ol.hoverbox
      %li
        = link_to image_tag(brand.photo.url, :alt => brand.name, :class => "preview"), brand_path(brand)
        /= link_to image_tag(brand.photo.url), { :class => "preview"}
        .abc      
          = brand.name

我不明白为什么会出现这个错误 BrandsController#index中的ArgumentError 错误的参数数量(2对1)

0 个答案:

没有答案