假设我有一个控制器位于/admin/users/users_controller.rb
:
class Admin::UsersController < ApplicationController
def index
#..........
respond_to do |format|
format.html # the file /admin/users/index.html.haml will be returned implicitly
format.js # the file /admin/users/index.js.erb will be returned implicitly
end
end
end
路线.rb
namespace :admin do
resource :users do
collection do
resources :tags, controller: :users_tags
end
end
end
如果我UsersTagsController
在同一目录中有一个控制器:
class Admin::UsersTagsController < ApplicationController
def index
#..........
respond_to do |format|
format.html # what file will be returned?
format.js # what file will be returned?
end
end
end
那么这种情况下会返回什么文件呢?