A simple Ruby on Rails clone of Twitter.
- Additional Ruby experience
- Learned Rails 4 concepts
- User authentication
- Application of REST model and MVC
- Introduction to a web framework
In the terminal, type
% bundle
The following gems were used:
- bootstrap
- bcrypt
- faker
- paginate
First, create the database
% rake db:migrate
Then run the server
% rails s
In a browser, go to
% localhost:3000
If the gem, 'postgres' doesn't work (as it initially gave me problems in my development), I found using
% sudo apt-get install libpq-dev
and then going through the above steps again circumvented the problem.
- Start off by creating an account. All you have to do is provide your name, email, and password (no account validation so you can get started right off the bat!)
- Customize your avatar (using Gravatar)
- Start following people to populate your feed
- Make posts: these will appear on your feed and profile view
- User
validates all user authentication has_many :following has_many :followers has_many :microposts defines user's feed
- Relationship
belongs_to :follower, belongs_to :followed
- Micropost
belongs_to :user
- Users/edit
change user settings
- Users/index
displays all users
- Users/show
user's profile page
- Static_Pages
either displays home or a user's feed depending on whether they are logged in
- Shared/micropost_form
seen in action underneath the user's stats in their feed; this is the different submission options and text box for posting
- Shared/stats
displays number of posts, followers and those user follows
- Shared/feed
generates feed in the home page
- Sessions
new is simply for a new login session
- Microposts
displays the posts themselves individually with data type
- Layouts/header
used as the navbar
- microposts
create and destroy (but only by the correct user)
- sessions/ relationships
defines create and destroy
- user
defines following, followers, show, new, edit and create
- static_page
checks if user is logged in, session's view