手动创建视图时“缺少模板”

时间:2012-11-05 14:44:06

标签: ruby-on-rails view routing

我在controllers / admin / orders.rb

中创建控制器
def index
    @pre_orders = Order.all
    @orders = Kaminari.paginate_array(@pre_orders).page(params[:page]).per(20)

  end

我有这样的路线:

namespace :admin do
    # Directs /admin/products/* to Admin::ProductsController
    # (app/controllers/admin/products_controller.rb)
    resources :orders
  end

在views / admin / orders / index.html.haml中查看

但是当我去...... 3000 / admin / order我得到 模板缺失

Missing template admin/orders/index, application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in: * "/*******/app/views" * "/home/pavel/.rvm/gems/ruby-1.9.3-p194/gems/kaminari-0.14.1/app/views" * "/home/pavel/.rvm/gems/ruby-1.9.3-p194/gems/devise-2.1.2/app/views"

0 个答案:

没有答案