Skip to content

Instantly share code, notes, and snippets.

@astux7
Last active August 12, 2016 15:27
Show Gist options
  • Save astux7/3803d5223de918c30863c6b698c7ec43 to your computer and use it in GitHub Desktop.
Save astux7/3803d5223de918c30863c6b698c7ec43 to your computer and use it in GitHub Desktop.
guide how to add twitter widget to your website

Twitter widget

Written by Asta Bevainyte, @astux7

This exercise is intended to teach how to use twitter widget and how to add it to the http://localhost:3000/pages/info

Where is 2 ways to do it, if you want to do it quick just adding a prepared code, go to paragraph 2.

Coach explain what is widget.

1.Twitter widget configuration

2.Add Twitter generated code to your info page

  • You have Twitter coppied code which looks like this if you selected profile and embedded timeline options (_your_twitter_username - you need to change to your twitter name)
  <a class="twitter-timeline" href="https://twitter.com/_your_twitter_username">
    Tweets by _your_twitter_username
  </a>
  <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
  • Add this code to app/views/pages/info.html.erb at the end of the file

  • Save and run rails server

  • Open your browser and go to http://localhost:3000/pages/info and check your Twitter profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment