title: Navbar Partial Throwing ActionView::Template::Error Exception for notification gem
body: <p>I'm using the <strong>notification</strong> gem by <strong>rails-engine</strong> <a href="https://github.com/rails-engine/notifications" rel="nofollow noreferrer">https://github.com/rails-engine/notifications</a>. It seems to be failing when I traverse to the controller index page for it. It's claiming that the links in my navigation partial are undefined when they clearly are. The NotificationController is the only one having this issue right now. I never used this gem before today. My code is below</p>
  
  <p>Exception</p>
  
  <pre><code>Started GET "/notifications" for 127.0.0.1 at 2017-09-04 16:06:51 -0400
  Processing by Notifications::NotificationsController#index as HTML
    User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
    Notification Load (0.0ms)  SELECT  "notifications".* FROM "notifications" WHERE "notifications"."user_id" = $1 ORDER BY id desc LIMIT $2 OFFSET $3  [["user_id", 1], ["LIMIT", 25], ["OFFSET", 0]]
    Rendering notifications/notifications/index.html.erb within layouts/application
    Rendered notifications/notifications/index.html.erb within layouts/application (96.1ms)
    Rendered nav_partials/_user_navbar.html.erb (2572.3ms)
  Completed 500 Internal Server Error in 8155ms (ActiveRecord: 1.0ms)
  
  
  
  ActionView::Template::Error (undefined local variable or method `dashboard_index_path' for #&lt;#&lt;Class:0xc0ceb08&gt;:0xc0ccff0&gt;):
       6: 
       7:     &lt;ul class="navbar-nav mr-auto mt-2 mt-md-0 user-nav-li-padding"&gt;
       8:       &lt;li class="nav-item white-nav-link mobile-nav-link"&gt;
       9:         &lt;%= active_link_to dashboard_index_path, class_active: 'nav-link active', :class_inactive =&gt; 'inactive' do %&gt;
      10:             &lt;div class="left"&gt;
      11:               &lt;%= inline_svg 'user_navbar_icons/home_icon_inactive.svg', width: 50, height: 50 %&gt;
      12:             &lt;/div&gt;
  </code></pre>
  
  <p>_navbar.html.erb</p>
  
  <pre><code>&lt;nav class="navbar fixed-top navbar-toggleable-sm pull-nav-to-front"&gt;
    &lt;button class="navbar-toggler navbar-toggler-right hidden-md-up" type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-controls="#navbar-collapse" aria-expanded="false" aria-label="toggle navigation" style="background-color: #fdfeff;"&gt;&amp;#9776;&lt;/button&gt;
    &lt;div class="collapse navbar-collapse mobile-nav-bg" id="navbar-collapse"&gt;
  
      &lt;ul class="navbar-nav mr-auto mt-2 mt-md-0 user-nav-li-padding"&gt;
        &lt;li class="nav-item white-nav-link mobile-nav-link"&gt;
          &lt;%= active_link_to dashboard_index_path, class_active: 'nav-link active', :class_inactive =&gt; 'inactive' do %&gt;
              &lt;div class="left"&gt;
                &lt;%= inline_svg 'user_navbar_icons/home_icon_inactive.svg', width: 50, height: 50 %&gt;
              &lt;/div&gt;
              &lt;div class="right"&gt;
                &lt;p&gt;My Dashboard&lt;/p&gt;
              &lt;/div&gt;
  
          &lt;% end %&gt;
  
        &lt;/li&gt;
  
        &lt;li class="nav-item white-nav-link mobile-nav-link"&gt;
          &lt;%= active_link_to posts_path, class_active: 'nav-link active', :class_inactive =&gt; 'inactive' do %&gt;
              &lt;div class="left"&gt;
                &lt;%= inline_svg 'user_navbar_icons/post_icon_inactive.svg', width: 50, height: 50 %&gt;
              &lt;/div&gt;
              &lt;div class="right"&gt;
                &lt;p&gt;Posts&lt;/p&gt;
              &lt;/div&gt;
          &lt;% end %&gt;
        &lt;/li&gt;
  
        &lt;li class="nav-item white-nav-link mobile-nav-link"&gt;
          &lt;%= active_link_to mailbox_index_path, class_active: 'nav-link active', :class_inactive =&gt; 'inactive' do %&gt;
              &lt;div class="left"&gt;
                &lt;%= inline_svg 'user_navbar_icons/mail_icon_inactive.svg', width: 50, height: 50 %&gt;
              &lt;/div&gt;
              &lt;div class="right"&gt;
                &lt;p&gt;Messages&lt;/p&gt;
              &lt;/div&gt;
          &lt;% end %&gt;
        &lt;/li&gt;
        &lt;li class="nav-item white-nav-link mobile-nav-link"&gt;
            &lt;small class="badge badge-default notifications-counter-badge"&gt;&lt;%= notification_count_for(current_user) %&gt;&lt;/small&gt;
          &lt;%= active_link_to notifications_path, class_active: 'nav-link active', :class_inactive =&gt; 'inactive' do %&gt;
  
              &lt;div class="left"&gt;
                &lt;%= inline_svg 'user_navbar_icons/notification_icon_inactive.svg', width: 50, height: 50 %&gt;
              &lt;/div&gt;
              &lt;div class="right"&gt;
                &lt;p&gt;Notifications&lt;/p&gt;
              &lt;/div&gt;
          &lt;% end %&gt;
        &lt;/li&gt;
        &lt;li class="nav-item white-nav-link mobile-nav-link"&gt;
          &lt;%= active_link_to favorites_index_path, class_active: 'nav-link active', :class_inactive =&gt; 'inactive' do %&gt;
              &lt;div class="left"&gt;
                &lt;%= inline_svg 'user_navbar_icons/favorite_icon_inactive.svg', width: 50, height: 50 %&gt;
              &lt;/div&gt;
              &lt;div class="right"&gt;
                &lt;p&gt;Favorites&lt;/p&gt;
              &lt;/div&gt;
          &lt;% end %&gt;
        &lt;/li&gt;
        &lt;li class="nav-item white-nav-link mobile-nav-link"&gt;
          &lt;div class="dropdown"&gt;
            &lt;%= active_link_to '#', active: false, class: 'btn dropdown-toggle', class_active: 'nav-link active ', :class_inactive =&gt; 'inactive', id: 'dropdownmenubtn', data: { toggle: 'dropdown' }, aria: {haspopup: true, expanded: false } do %&gt;
                &lt;div class="left"&gt;
                  &lt;%= inline_svg 'user_navbar_icons/settings_icon_inactive.svg', width: 50, height: 50 %&gt;
                &lt;/div&gt;
                &lt;div class="right"&gt;
                  &lt;p&gt;Settings&lt;/p&gt;
                &lt;/div&gt;
                &lt;div class="dropdown-menu dropdown-menu-right settings-dropdown-menu-margin-pos dropdown-menu-font-color" aria-labelledby="dropdownmenubtn"&gt;
                  &lt;h6 class="dropdown-header"&gt;&lt;%= current_user.username %&gt;&lt;/h6&gt;
                  &lt;div class="dropdown-divider"&gt;&lt;/div&gt;
                  &lt;%= link_to 'Account Settings', edit_user_registration_path, class: 'dropdown-item' %&gt;
                  &lt;%= link_to 'Help', user_help_index_path, class: 'dropdown-item' %&gt;
                  &lt;div class="dropdown-divider"&gt;&lt;/div&gt;
                  &lt;%= link_to 'Logout', destroy_user_session_path, class: 'dropdown-item', method: :delete %&gt;
                &lt;/div&gt;
            &lt;% end %&gt;
          &lt;/div&gt;
  
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/nav&gt;
  
  &lt;script type="text/javascript"&gt;
    $(document).on('turbolinks:load', function() {
        $('.dropdown-toggle').dropdown()
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>application.html.erb</p>
  
  <pre><code>   &lt;body&gt;
      &lt;% if user_signed_in? %&gt;
          &lt;%= render 'nav_partials/user_navbar' %&gt;
      &lt;% elsif admin_signed_in? %&gt;
      &lt;%= render 'nav_partials/admin_navbar' %&gt;
      &lt;% else %&gt;
          &lt;%= render 'nav_partials/navbar' %&gt;
      &lt;% end %&gt;
  &lt;%= yield %&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p>notifications_controller.rb</p>
  
  <pre><code>module Notifications
    class NotificationsController &lt; Notifications::ApplicationController
  
      def index
        @notifications = notifications.includes(:actor).order('id desc').page(params[:page])
  
        unread_ids = @notifications.reject(&amp;:read?).select(&amp;:id)
        Notification.read!(unread_ids)
  
        @notification_groups = @notifications.group_by { |note| note.created_at.to_date }
      end
  
      def clean
        notifications.delete_all
        redirect_to notifications_path
      end
  
      private
  
      def notifications
        raise "You need reqiure user login for /notifications page." unless current_user
        Notification.where(user_id: current_user.id)
      end
    end
  end
  </code></pre>
  
  <p>notifications index</p>
  
  <pre><code>&lt;div class="notifications row"&gt;
    &lt;div class="heading clearfix"&gt;
      &lt;%= t('notifications.all_notifications') %&gt;
  
      &lt;span class="pull-xs-right"&gt;
        &lt;%= link_to t('notifications.clean_all'), notifications.clean_notifications_path, class: 'btn btn-sm btn-secondary', method: 'delete' %&gt;
      &lt;/span&gt;
    &lt;/div&gt;
    &lt;div class="list"&gt;
      &lt;% if @notifications.blank? %&gt;
        &lt;div class="no-records"&gt;&lt;%= t('notifications.no_records') %&gt;&lt;/div&gt;
      &lt;% else %&gt;
        &lt;% @notification_groups.each do |group, notifications| %&gt;
          &lt;div class="notification-group"&gt;
            &lt;div class="group-title"&gt;&lt;%= group %&gt;&lt;/div&gt;
            &lt;%= render notifications %&gt;
          &lt;/div&gt;
        &lt;% end %&gt;
      &lt;% end %&gt;
    &lt;/div&gt;
    &lt;%= paginate @notifications %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>_notification.html.erb</p>
  
  <pre><code>&lt;%= cache(['notifications', Notifications::VERSION, notification]) do %&gt;
  &lt;div id="notification-&lt;%= notification.id %&gt;"
       data-id="&lt;%= notification.id %&gt;"
       class="media notification notification-&lt;%= notification.notify_type %&gt;&lt;%= ' unread' unless notification.read? %&gt;"&gt;
    &lt;div class="media-left"&gt;
      &lt;% if notification.actor_profile_url &amp;&amp; notification.actor_avatar_url %&gt;
        &lt;%= link_to image_tag(notification.actor_avatar_url), notification.actor_profile_url, title: notification.actor_name, class: 'user-avatar' %&gt;
      &lt;% end %&gt;
    &lt;/div&gt;
    &lt;div class="media-body"&gt;
      &lt;%= render partial: "/notifications/#{notification.notify_type}", locals: { notification: notification } %&gt;
    &lt;/div&gt;
    &lt;div class="media-right"&gt;
      &lt;%= l notification.created_at, format: :short %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>notification _follow.html.erb</p>
  
  <pre><code>&lt;div class="media-heading"&gt;
    &lt;%= link_to notification.actor.username, notification.actor %&gt; just followed you.
  &lt;/div&gt;
  </code></pre>
  
  <p>routes.rb</p>
  
  <pre><code>  Rails.application.routes.draw do
  
    mount Notifications::Engine =&gt; "/notifications"
  
  
    mount Payola::Engine =&gt; '/payola', as: :payola
    mount CountryStateSelect::Rails::Engine, at: "/"
  
    devise_for :admins
    devise_for :users
  
    namespace :api do
      scope :v1 do
        mount_devise_token_auth_for 'User', at: 'user_auth'
      end
    end
  
    devise_scope :user do
      put 'user_change_plan', :to =&gt; 'users/registrations#user_change_plan'
      put 'user_update_credit_card', :to =&gt; 'users/registrations#user_update_credit_card'
      authenticated do
        root to: 'user_dashboard#index', as: 'authenticated_user_root'
      end
  
      unauthenticated do
        root to: 'home#index', as: 'unauthenticated_user_root'
      end
    end
    end
  
    devise_scope :admin do
      authenticated do
        root to: 'admin_dashboard#admin', as: 'authenticated_admin_root'
      end
  
      unauthenticated do
        root to: 'home#index', as: 'unauthenticated_admin_root'
      end
    end
  
  
    controller :home do
      get :index, to: 'home#index', as: 'home', :path =&gt; 'home'
      get :login_portal, to: 'home#login_portal', as: 'login_portal', :path =&gt; 'login_portal'
      get :signup_portal, to: 'home#signup_portal', as: 'signup_portal', :path =&gt; 'signup_portal'
    end
  
    resources :user_dashboard, as: 'dashboard', :only =&gt; [:index, :show]
    resources :comments
    resources :posts do
      member do
        post :share
        put 'like', to: 'posts#like'
        get 'like', to: 'posts#like'
      end
    end
  
    resources :users, only: [:show, :index, :update], path: 'u' do
      get 'users/:username' =&gt; 'users#show'
      patch 'users/:username', to: 'users#update'
      resources :follows, :only =&gt; [:create, :destroy]
    end
    controller :favorites do
      get 'favorites/index'
    end
  
    resource :user_profile, :only =&gt; [:edit, :update], path: 'profile'
      root 'home#index'
  end
  </code></pre>
  
  <p>I tried to include the Notifications module instead of wrapping the controller inside of it. It doesn't work as well.</p>
  
  <pre><code>500 Internal Server Error If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.
  </code></pre>