This may help some of you.
If you find that this code doesn't work:
$(document).on "turbolinks:load", -> $("#new_message").on "keypress", (e) -> if e && e.keyCode == 13 e.preventDefault() $(this).submit()
Try changing the last line to reflect an ID, like this:
For some reason, using (this) didn't seem to work for me, but using the ID worked great.
Does anyone know how to fix this issue? The ampersand is showing up in html, rather than showing the ampersand symbol. Ironically, Chinese characters show up fine. :D
Thanks for any feedback.
I know gonative.io can turn your rails app directly into a native mobile app on android and ios. I don't know if it works for APIs. Also, I haven't yet done it myself, but there's a cool feature on the homepage. Just type in your rails app url and it automatically shows you what it would look like as a mobile app. Costs about $600 I think to do the conversion.
This is the error in the rails console:
Does this mean I forgot to create a post method somewhere?
Okay! I'll try that. :D
I believe Chris created a newer video that shows how to do this using actioncable.
I have noticed this same issue. The bell itself doesn't appear for about 2 seconds, and then 3 seconds later, the notification number appears... If anyone has a fix, that would be great.
The notifications are working. What you call threads, we call posts, and what you call posts, we call comments.
1) It only works when the json.url line is commented out:
json.url post_path(notification.notifiable.post, anchor: dom_id(notification.notifiable))
As soon I uncomment, notifications totally stop working--the number disappears from the bell, and the notification messages themselves also disappear. Once I comment out the line again, the bell numbers return, and so do the notifications. Thoughts on how to get that to work? We definitely would like each notification to be linkable to that particular event.
2) we are showing messages for both posts (post_path) and also comments (comment_path). But how will index.json.builder know when to follow the post_path, and when to follow the comment_path? And then again, once we add other notifiable events, like reaching a higher level, etc.?
Thanks very much!
Ahh, once it's automatic, then it's all on autopilot, and that would be fantastic. Do you have any idea when they may be implementing the automatic referral payouts?
Also, do you happen to know if there's a way to setup 'repeated payouts', i.e. if you refer someone to us, then every time that person purchases something from our site, you would receive a 5% payout for that purchase for life? That would be neat.
Posted in Team tracking?
Is there or will there be a way to see which videos my team have watched, and how many, and what their XP scores are, etc, all on the team page? And see whether they actually watched, or just clicked 'completed'? Having some basic stats will help me to know who is taking advantage of the subscription, and who is not. It's not crucial, but would be helpful down the line to encourage more communication between the team, and to help me know what videos are of most interest to those on the team.
Thanks for your consideration.
Do you mean 10,000 simultaneous users of the chat, or just having 10,000 users on the site itself?
Chris just answered my question in the Slack group. Here are the two answers:
1) @blatz was right about calling the association on a relation, User.all wouldn't be an individual record with associations, you could only call scopes on it. if you did User.first.conversations you could destroy_all. Or you can just use Mailboxer::Conversation.destroy_all.
Mailboxer models are namespaced, you can see them in the gem. It's one of those gems that referencing the source code comes in handy pretty often
2) The extraneous prinout is because you have an equals in your loop <%= when you don't want it. It should be <%
And... both answers were spot on (as if Chris could provide anything less).
Thank you to Blatz too for your help. Onward!
I posted these questions in Slack, but also posted them here, because I'm sure the answer will help someone else:
I am working on the in-app messaging, and I have two issues:
- I am trying to delete all conversations in rails console. But when I type
u = User.alland then
u.conversations.destroy_all, it says it can't find that model.
- I don't know why, but there is database data showing up at the bottom of the conversations index, and also the message show pages. Like this: https://gyazo.com/b343640d979eb42f9c12c19c6d64a55d Does anyone know why that is showing up? The views have no extraneous code. (edited)
Thank you for your help!
Great stuff. Thank you again!
Question: if someone does end up refactoring or updating the gem, does that mean that suddenly our mailbox uploading feature will cease to function? Or would that only be an issue if we updated to a revised version of the gem without making the required new changes to the code?
Finding GoRails is a Godsend. These videos are SO fascinating. Not only do I get step by step guidance adding a new feature, but I learn so much in the process. First I watch the entire videos straight through at 1.25 speed to get the gist and make sure I understand everything. Then I go back again and watch them at normal speed, pausing along the way to implement and test each step. It's really fun! And I get to see a new feature come to life before my eyes. Bravo Chris!
Another fantastic tutorial.
a) If we install mailboxer and down the line want to give users the option to add multiple receipients, i.e. a 'private group chat', does mailboxer allow this? If so, this looks like a great option. *UPDATE: I see that video 3 discusses this. *
b) I installed notifications using your other tutorial. Should I use that same line of code here to create notifications in our bell, or is it best to use the mailboxer notifications? Or is it a combination of both?
c) I saw one person ask about how a user can trash/delete messages, but it doesn't appear you've yet responded. Is that covered as well?
Thanks ever so much.
Oh that sounds like a winner! And one I haven't heard of before. Thank you Chris.
I am trying to understand Ruby and Rails as best I can. I've purchased a bunch of ruby on rails books, but am wondering if you have any recommendations. Perhaps there are many I haven't yet read to help me get a better understanding of everything that's going on?