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
精彩评论