Save 36% for Black Friday! Learn more

All threads / I'm having issues with in-app notifications on my App

Ask A Question

Notifications

You’re not receiving notifications from this thread.

I'm having issues with in-app notifications on my App

Tolase Kelvin Adegbite asked in Rails

Hello! Can someone please enlighten me on how to create notifications (In-app) for this type of routes
I want to display notifications when comments are made on episodes. This worked well when i did for genres and stories.

resources :genres do 
    resources :stories do
        resources :episodes do
            resources :comments
        end
    end
end

I actually want notifications for comments. Whwn i tried out the In-App notification tutorial on this website, i got an error undefined route "episode_path" in the** index.html.jbuilder file**, and i think i am not setting the notification URL well.
Help a friend.
Thanks.

Run rake routes or 5.x rails routes, and check how the routes looks like. Based on above routes files, it's defintely not episode_path.

Thanks for your response man. I did... something like this:

json.url genre_story_episode_path(@genre, @story, episode.id)(notification.notifiable.episode, anchor: dom_id(notification.notifiable))

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 39,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.