scambra/devise_invitable — Issue #164: missing route 'accept_invitation'
Author: mustmodify
Created: 2012-02-03 17:03:57+00:00
State: open

Using:
> gem 'rails', '3.1.3'
> gem 'devise', '~> 1.4.3'
> gem 'devise_invitable'

From your example:

> 1.9.3p0 :042 > User.invite!(:email => "new_user@example.com", :name => "John Doe", :skip_invitation => true)

I get this unhelpful message:

> ActionView::Template::Error: ActionView::Template::Error
> from /projects/jinna/sherlock/vendor/bundle/gems/actionpack-3.1.3/lib/action_dispatch/http/url.rb:25:in `url_for'
> from /projects/jinna/sherlock/vendor/bundle/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:522:in `url_for'
> from /projects/jinna/sherlock/vendor/bundle/gems/actionpack-3.1.3/lib/action_dispatch/routing/url_for.rb:147:in `url_for'
> from /projects/jinna/sherlock/vendor/bundle/gems/actionpack-3.1.3/lib/action_view/helpers/url_helper.rb:107:in `url_for'
> from /projects/jinna/sherlock/vendor/bundle/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:201:in `root_url'
> from /projects/jinna/sherlock/vendor/bundle/gems/devise_invitable-0.6.1/app/views/devise/mailer/invitation_instructions.html.erb:3:in `_vendor_bundle_gems_devise_invitable_______app_views_devise_mailer_invitation_instructions_html_erb__1122416159933056376_22186260'

It seems to be calling accept_invitation, which is missing from my routes:

> jw@eagle:/projects/jinna/sherlock$ bundle exec rake routes | grep invitation
> accept_user_invitation GET /users/invitation/accept(.:format) {:action=>"edit", :controller=>"devise/invitations"}
> user_invitation POST /users/invitation(.:format) {:action=>"create", :controller=>"devise/invitations"}
> new_user_invitation GET /users/invitation/new(.:format) {:action=>"new", :controller=>"devise/invitations"}
> PUT /users/invitation(.:format) {:action=>"update", :controller=>"devise/invitations"}
> case_invitations GET /cases/:case_id/invitations(.:format) {:action=>"index", :controller=>"invitations"}
> POST /cases/:case_id/invitations(.:format) {:action=>"create", :controller=>"invitations"}
> new_case_invitation GET /cases/:case_id/invitations/new(.:format) {:action=>"new", :controller=>"invitations"}
> edit_case_invitation GET /cases/:case_id/invitations/:id/edit(.:format) {:action=>"edit", :controller=>"invitations"}
> case_invitation GET /cases/:case_id/invitations/:id(.:format) {:action=>"show", :controller=>"invitations"}
> PUT /cases/:case_id/invitations/:id(.:format) {:action=>"update", :controller=>"invitations"}
> DELETE /cases/:case_id/invitations/:id(.:format) {:action=>"destroy", :controller=>"invitations"}

I'm going to temporarily copy the accept_user_invitation route, but would like to know if this is a bug or whether I have messed up during my installation.