-
Notifications
You must be signed in to change notification settings - Fork 78
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
Default address showing users/3/notifications? #64
Comments
Hi, Currently, you cannot use route address by activity_notification's router, but you can do it by writing the routes with notification_controller in routes.rb yourself. Thanks |
@simukappu Can you explain a bit detail? Some sample code is really useful! |
on
|
@RailsCod3rFuture any idea bro? |
I will look into this error tomorrow. I've been swamped lol. But, I really need to get the routes fixed, so that nothing malicious can happen between users. |
Could @simukappu give us a simple demonstration controller/route config that satisfies the requirements we're looking for? The generic controller that is included, seems pretty vast, & I don't have the time/schedule to make serious errors/mistakes. I'm getting ready to test this build on a live server. Please, post a working gist that we can look into and analyze to remove the user/id out of the address bar. Thanks. @truongnmt |
Hi @RailsCod3rFuture, @truongnmt, I have added implementation for default routes with devise integration to activity_notification gem. You can add the routes as follows: notify_to :users, with_devise: :users, devise_default_routes: true And you will see the routes like this:
Thanks! |
Hello @simukappu, thanks so much for reaching out. Sorry but may I ask after checkout to develop, how can I test, does that mean build gem again? 😅 |
@truongnmt @simukappu You have to target the branch and rebuild the gem, I believe. |
I will check it out now. Thanks for extending the functionality for your gem. |
@truongnmt gem 'activity_notification', :git => 'https://github.com/simukappu/activity_notification', :branch => 'development' |
@simukappu I'm receiving errors when I access the index.html.erb using <%= link_to "Notifications", notifications_path %> . The routes don't seem to be working with the new changes. Its still seeing the old routes.
are you facing the same issue @truongnmt ??? |
Ups, this seems error at default view template. I will check it later. |
Ok. Let me know when to recheck. |
I have tested it with both route confuguration notify_to :users, with_devise: :users
notify_to :users, with_devise: :users, devise_default_routes: true Can you try this configuration at first? |
It's working now! PERFECT. You should push this feature up to production. I had to split the routes. |
Thank you! |
ok. I'll be waiting for it. |
Just released as v1.6.0. |
Great, I will be switching over to the new gem. |
Hey @simukappu , great work here ! I noticed the two lines are required, otherwise an exception is thrown as |
Great work here!!! Thanks man! I just tried to make it work with: notify_to :users, with_devise: :users, devise_default_routes: true and I need to tweak a few places at the default view, passing Do you mind if I open a PR just to explain those stuff in README @simukappu |
How do you remove /:target_type/:target_id from route address? and leave only /notifications. Is it possible with your gem? I'm using notify_to :users, with_devise: :users
The text was updated successfully, but these errors were encountered: