Rails,控制器继承w路由

时间:2010-11-09 20:32:17

标签: ruby-on-rails ruby-on-rails-3 devise

我正在使用设计邀请:gem on github

我想实现控制器继承,所以我添加了一个控制器:

class InvitationsController < Devise::InvitationsController
  include Devise::Controllers::InternalHelpers

  before_filter :authenticate_inviter!, :only => [:new, :create]
  before_filter :require_no_authentication, :only => [:edit, :update]
  helper_method :after_sign_in_path_for

  # GET /resource/invitation/new
  def new
    build_resource
    render_with_scope :new
  end
..
.

并将我的路线更新为:

  devise_for :users, :controllers => {:invitations => "invitations"}

但是我收到了一个错误:

"Template is missing
Missing template invitations/new with {:formats=>[:html], :locale=>[:en, :en], :handlers=>[:rjs, :builder, :rhtml, :erb, :rxml]} in view paths "/Users/bhellman/Sites/cline/app/views", "/Library/Ruby/Gems/1.8/gems/devise_invitable-0.3.5/app/views", "/Library/Ruby/Gems/1.8/gems/devise-1.1.3/app/views""

你能帮我理解我的路线错误吗?

1 个答案:

答案 0 :(得分:1)

据我所知,您已经有了正确的路线,而您错过的是views/invitations/new.html.erb档案。