开发者

Devise invitable - How to add a Method to InvitationsController < Devise::InvitationsController

开发者 https://www.devze.com 2023-03-04 19:53 出处:网络
I\'m using the devise invitable gem: https://github.com/scambra/devise_invitable My A开发者_如何学Pythonpp also has a controller: invitations_controller.rb, which starts with:

I'm using the devise invitable gem: https://github.com/scambra/devise_invitable

My A开发者_如何学Pythonpp also has a controller: invitations_controller.rb, which starts with:

class InvitationsController < Devise::InvitationsController

I'm allowing users to register with FB and would like to add a method to this controller:

def fb_create
  Rails.logger.info 'fb_createfb_createfb_createfb_createfb_createfb_createfb_createfb_createfb_create'
end

I tried adding this to my routes.rb file as so:

post  "/users/invitation/fb_create" => "invitations#fb_create"

But that failed. How can I add a route for this method?

Currently my routes has been using this for devise:

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

Thanks


devise_for :users, :controllers => {:invitations => "invitations", :sessions => "sessions", :registrations => "registrations"} do
    post  "/users/invitation/fb_create" => "invitations#fb_create", :as => "invitation_fb_create"
end

that would generate invitation_fb_create_path helper method pointing to that action

0

精彩评论

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

关注公众号