GithubHelp home page GithubHelp logo

bookmarks's Introduction

               ***     ***
             **   ** **   **
            *       *       *
            *               *
             *             *
              **         **
                **     **
                  ** **
                    *
 ____       _ _        ____ _      _
|  _ \ __ _(_) |___   / ___(_)_ __| |___
| |_) / _` | | / __| | |  _| | '__| / __|
|  _ < (_| | | \__ \ | |_| | | |  | \__ \
|_| \_\__,_|_|_|___/  \____|_|_|  |_|___/

Welcome to the B❤❤kmarx Rails Girls app!

We’re going to develop a simple bookmarks sharing app. People will be able to signup/signin, add their bookmarks and fork others :-)

See finished work in action: rgr13-bookmarks.herokuapp.com.

Setup Devise

  • add devise gem and run setup scripts

    > rails generate devise:install
    > rails generate devise User
  • add ‘username’ attribute to devise migration

  • remove ‘recoverable’ and ‘confirmable’ stuff from devise migration

  • validating presence and uniqueness of username in User model

  • generate views, add username field to signup form

    > rails g devise:views
  • run migration

    > rake db:migrate
  • go to /users/sign_up

  • run rails console

    > rails c
    -> User.all

Add Bookmark resource

  • generate scaffold for Bookmark resource

    > rails g scaffold bookmark title url user_id:integer
    > rake db:migrate
  • add validations and relations between User and Bookmark

  • require User authentication to manage Bookmark

  • order Bookmark by descending creation date

Better views

  • integrate Twitter Bootstrap by installing bootstrap-sass gem

  • add prettier styles and remove css scaffold

Improvements

  • add home page with all bookmarks

  • show User’s bookmarks in bookmarks index page

  • add public User profile

  • remove #show action for Bookmark

    • views

    • controller

  • add pagination

    • add kaminari gem

      > rails generate kaminari:config

    • add pagination to index pages

    • adapt pagination to bootstrap

      > rails generate kaminari:views bootstrap

Deploy

  • add postgresql gem for production

  • setup Puma web server

    • add Procfile: web: bundle exec rails server puma -p $PORT -e $RACK_ENV

    • add .env: set RACK_ENV and RAILS_ENV to development

  • prevent environment to be loaded during assets precompile:

    • add “config.assets.initialize_on_precompile = false” to config/application.rb

  • create heroku app:

    > heroku create rgr13-yourname-bookmarks

DIY

  • improve html and css (show finished work)

  • use username instead of id in public User profile url

  • handle profile not found error (redirect to profiles path with an alert notice)

  • add prettier tables to show Bookmarks

  • fork Bookmarks

Push to Heroku

* heroku apps:create rgr13-bookmarks-<developer name>

* ssh keygen -t rsa

* heroku keys:add ~/.ssh/id_rsa.pub

* git push heroku master

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.