Alex Lutz

Joined

4,260 Experience
42 Lessons Completed
0 Questions Solved

Activity

For the disconnect button on Rails 7, I used this and it's working correctly with the confirm now. Hope it helps!

<%= link_to "Disconnect", twitter_account, data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: "btn btn-danger" %>

Thank you for this! Definitely ran into it. Works well. Also allows me to fix another issue I was having on a previous video.

On Rails 7 - to get my "Connect a Twitter Account" button to work correctly, I needed to use the following:

<%= button_to "Connect a Twitter account", "/auth/twitter/", method: :post, :data => { turbo: "false" }, class: "btn btn-primary"%>

I also noticed that on my Disconnect button, the confirm "Are you sure?", would not show. I'm guessing it has to do with the button_to and turbo_confirm or something? If anyone figures this out, would love a reply.

Posted in Rails for Beginners Part 26: Table Plus Discussion

Yes, I explained this whole process in the last video "Rails for Beginners Part 25: Twitter Account Model" -- check the comments.

I noticed when my twitter_account was being saved to the database that most of the fields were nil.

Looking at the rails server logs, I noticed I received some information about elevated access.

It includes the message "You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you'll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve"

For some context -- on 4/21/2022
I created a brand new twitter account for this application.
I tied that new twitter account to a brand new developer account.

App Details: 
    Name: @mytwitterusername Scheduled Tweets
    App Icon: Left it the default
    Description: GoRails.com Rails for Beginners Tutorial
User authentication settings:
    OAuth 2.0: ON
    OAuth 1.0a: ON
    OAuth 2.0 Settings: Type of App = Web App
    OAuth 1.0a Settings:
        Request email from users: ON
        App Permissions: Read and Write
        Callback URI / Redirect URL: https://localhost:3000/auth/twitter/callback 

I had to request the new "Elevated Access" in order for my twitter_account object to contain all the requested information from the `auth` hash.

To request Elevated access - https://developer.twitter.com/en/portal/products/elevated - Click the "Apply for Elevated" button.

Disclaimer: I'm sharing what I did to continue onwards with the tutorial. This is by no means what you should put in your situation. I'm not responsible for your input in this request, also I'm NOT a lawyer and yada yada, essentially be honest and fill this stuff out according to your own use case. 

I went through their "wizard" and essentially said the following for most large paragraph entries: 
    How will you use the Twitter API or Twitter Data? 
        "I'm learning Ruby on Rails from Chris Oliver's Beginner Rails tutorial on GoRails.com and intend to use the Twitter API for this Scheduled Tweets application. I plan to schedule tweets to post on my own personal Twitter account for development purposes only." 
Are you planning to analyze Twitter Data: NO
Will your App use Tweet, Retweet, Like, Follow, or Direct Message: YES
    *pasted explanation paragraph text from above*
Do you plan to display Tweets or aggregate data about Twitter content outside Twitter? NO or YES 
    If Yes, *pasted explanation paragraph text from above*
Will your product, service, or analysis make Twitter content or derived information available to a government entity? NO
NEXT, NEXT, Accept Developer Agreement. 
My Approval was Instant -- re-ran the process to create the twitter_account object and it successfully created.     
You can also verify you have Elevated access here: https://developer.twitter.com/en/portal/products 

Lol. Made the same mistake.

  • Make sure to sign in the to application so there IS a Current.user.
  • Then Connect your Twitter Account.
logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.