Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionView::Template::Error: No route matches during email notification #46

Closed
grzegorz-jakubiak opened this issue Nov 22, 2017 · 1 comment

Comments

@grzegorz-jakubiak
Copy link

Hi, I get error presented below every time I invoke notification. The regular notification comes is but email doesn't because of the error.

ActionView::Template::Error: No route matches {:action=>"move", 
:controller=>"activity_notification/notifications_with_devise", :devise_type=>"users", :id=>nil, 
:locale=>#<User id: 7, username: "nowy",...

This is a fragment of my routes.rb file:

scope "/(:locale)", locale: /#{ I18n.available_locales.join("|") }/ do

    devise_for :users, skip: :omniauth_callbacks, controllers: {
      registrations: 'users/registrations',
      confirmations: 'users/confirmations',
      sessions: 'users/sessions'
    }

    notify_to :users, with_devise: :users
    ...

I've got notifications defined like this:

class User < ActiveRecord::Base
  acts_as_target email: :email, email_allowed: :confirmed_at
  acts_as_notifier printable_name: :username
  ...
class Comment < ActiveRecord::Base

  acts_as_notifiable :users,
    targets: -> (comment, key){
      if comment.owner.is_a?(Place)
        ba_places = comment.owner.business_account_places
        if ba_places.any?
          person_to_notify = ba_places.first.business_account.user
          ([person_to_notify] - [comment.user])
        else
          []
        end
      else
        []
      end
    },
    notifier: :user,
    email_allowed: true,
    notifiable_path: :place_notifiable_path

I've got config set to enable email by default. Any ideas how I could fix this? I need both the notification and email to be sent to user.

@simukappu
Copy link
Owner

Please see the referenced issue #56.
Closing this issue for now. Please reopen if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants