How do I create a reply button for a Twitter client that automatically fills in a username in the 'tweet' form?
-
01-10-2019 - |
Question
Using the Twitter API, and just want to have a simple 'reply' button on every tweet (say, 'How do I create a reply button?' from @kraykray) that automatically puts '@kraykray' into the tweet form. Don't need the system to log that it's any kind of special message.
Solution
you can do this with the help of rails javascript helpers or you can use only javascript to handle this problem as well.
Rails way On clicking the reply button call some action and pass the username as params to the action and render your textarea with the username as value for the textarea. Hope this helps
Please let me know if you need code snippets.You can improve the code, I am just trying to explain how you can do with javascript. I dint used jquery or prototype because, I donno which library you use.
Please check this link http://jsbin.com/atodu3/2