我正在学习 Ruby,我设置了一个这样的控制器:
class Mobile::HomeController < ApplicationController
def index
end
def create
end
end
这是非常基本的,并添加了这样的路线:
scope :module => :mobile, :as => :mobile do
constraints(:subdomain => /m/) do
resources :home
end
end
当我尝试在浏览器中查看该页面时,我收到此错误:
Missing template mobile/home/index, application/index with {:locale=>[:en, :en], :formats=>[:html], :handlers=>[:haml, :erb, :builder]}. Searched in: * "/Users/alexgenadinik/projects/cmply/cmply-app/app/views" * "/Library/Ruby/Gems/1.8/gems/ckeditor-3.6.3/app/views" * "/Library/Ruby/Gems/1.8/gems/kaminari-0.13.0/app/views" * "/Library/Ruby/Gems/1.8/gems/devise-2.0.4/app/views"
但我在这里有一个查看页面:
app/views/layouts/mobile/application.html.haml
我需要指定我在控制器中返回 HAML 格式的问题吗?还是我做错了什么?