开发者

Rails, Controller Inheritance w Routes

I'm using devise invitable: gem on github

I want to implement controller inheritance, so I added a controller:

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
..
.

And updated my routes to:

  devise_for :users, :controllers => {:invitations => "invitations"}
开发者_如何转开发

But I'm getting an error:

"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""

Can you help me understand what I did wrong with the routes?


As I know you have already had the right route and what you missed is the views/invitations/new.html.erb file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜