328 Testing JavaScript with Jasmine [1.5d]

Jasmine Archive is a great tool to unit test your JavaScript components without writing an expensive end-to-end test for every little thing.

Jasmine is a purely client-side tool. It cannot ask Rails to render a view or access the database. Any HTTP calls must be mocked.

Learn

What do we test with Jasmine?

Just as unit tests are a direct way to closely look at your classes, Jasmine is a very direct way to look at your JavaScript components.

For example, when you want to test that a date picker opens a calenda...

330 Images [1.5d]

Learn

Image formats

  • Understand the difference between raster images (like .png) and vector images (like .svg).
  • Understand why a print designer talks a lot about physical measurements like "cm" and "DPI" and why this rarely matters to us.
  • Understand how JPEG compression degrades the image quality every time you save the file.
  • Understand the strengths and weaknesses of the following file formats:
    • png
    • webp
    • gif
    • jpg
    • svg

High density displays

Browse the i...

335 Secure storage of file attachments [2d]

Read Deliver CarrierWave attachments to authorized users only.

Add the following feature to MovieDB:

  • Actors have a contract document
  • Only users with an admin role are allowed to upload or download contract documents
  • It should be impossible for an unauthorized user to access a contract document, e.g. by guessing the download URL

Create two implementations of this requirement:

  1. Contracts are saved to RAILS_ROOT/public/system, ...

350 Visual design basics [2.5d]

Learn

Read the following material:

355 Requirements analysis and minimum viable UIs [3d]

Many of our clients can't or don't want to design their user interfaces. In the absence of a good UI design, you should always be able to come up with a default. Since the user interface makes up 70% of a typical web application, this is closely related to requirements analysis and cost estimation.

Learn

Talk with your mentor about the following topics:

  • Extracting nouns from requirements prose
  • Drawing ER diagrams and minimizing boxes
  • Why nouns from the client domain do not always map to Ruby models 1:1. E.g. only if a "address...

370 Technology choice [0.5d]

Discussion

Growing Rails applications in practice

Read the following chapters from our book Growing Rails Applications in Practice Archive :

  • On following fashions
  • Surviving the upgrade pace of Rails
  • Owning your stack

Discuss each chapter with your mentor.

Being a good open-source citizen

Work through the follow resources:

372 Dealing with legacy applications [0.75d]

Adopting legacy Rails apps

Talk to your mentor about how we're approaching applications that are either old or abandoned by an earlier a different team:

  • Add E2E tests for the happy path. Other than unit tests, E2E tests will not break when we refactor later.
  • Always add tests on whatever we work on.
  • When you work on something, improve that part of the code.
  • Make sure setup for a new developer is as frictionless as possible (ideally it's bundle && rake db:create db:migrate).
  • Make sure deployment is as frictionless as possible...

385 Rack and Middlewares

Goal of this lesson is to understand what middlewares in Rack are good for.

Rack

Start with these articles:

You should be able to answer the following questions:

  • What is Rack?
  • How does Rack relate to Ruby on Rails?
  • What is Rack middleware?
  • What are some ...

395 Background processing [2d]

Some tasks in a web application are better not done live when a user request a page, but in the background. Examples are

  • longer running tasks
  • tasks that are not tied to user interaction
  • tasks that can fail, and may need to be retried

Our two main mechanisms for background processing are

Learn about cronjobs

  • Read [HowTo: Add Jobs To cron Under Linux or UNIX?](http:...

396 Internationalization (I18n) [2d]

Learn

Resources

397 Rails: Sending e-mail [2d]

Research

Exercises

  • In MovieDB, if you did not implement sending a welcome e-mail, send an e-mail now.
  • In MovieDB, whenever someone creates a movie, send a notification to `mo...

400 Buzzwords and staying up to date [1d]

Web technology is a broad field and you cannot be an expert in all aspects.

However, it is useful to have a rough understanding of common terms and buzzwords, so that you don't seem uninformed when talking to a client or other developers.

Get an overview

Search the Internet for each of the following terms. Only take a couple of minutes for each and don't get into too much detail. Do get a rough idea about the advantages they promise.

  • Continuous Integration or CI
  • Single-Page Application or SPA
  • `Progressiv...

910 Rake [0.75d]

Research

  • What is rake good for?
  • Take a look at some of the Rake tasks that Rails gives you (rake -T within a Rails project)
  • Find the code that defines the rake stats task in the Rails gems
  • What are some ways how a Rake task can execute another task?
  • What does it mean if a Rake task "depends" on another task? E.g. understand what it means for a Rake task within a Rails app to depend on :environment.
  • Understand that Capistrano tasks are also defined using the Rake DSL, but a Capistrano task is not automatically a...

940 Persisting trees [2d]

Storing a tree

For each movie in MovieDB, we want to track which other movie it was inspired by. For example:

  • "Interstellar was inspired by 2001"
  • "Inception was inspired by The Matrix"

Start by adding a field Movie#inspiration_id. In the movie form, I should be able to select the inspiring movie.

The list should:

  • include all the movies that were released in previous years
  • not include the movie itself
  • not include a movie that was itself inspired by the movie that is being edited.

Traversal

In the...

985 Modern build pipelines with Webpack [3d]

Rails ships with two separate build pipelines: Sprockets ("asset pipeline") and Webpacker.

Webpacker has many more moving parts, but allows us to use ES6 modules and npm packages (through Yarn). Webpacker is a wrapper around a JavaScript project called webpack Archive .

Yarn

Yarn is the package manager we use for JavaScript. It does for JavaScript roughly what Bundler does for Ruby.

Read the first couple of sections of its official documentation Archive .

You should learn how to:

  • Insta...

990 Static site generators

Learn

Talk with a colleague and find out why we're using building some of our sites using static site generators instead of Rails.

You should talk about:

  • Ease of development
  • Security issues and maintenance costs

Read through the Middleman docs Archive :

  • What can it do?
  • What can't it do?
  • What parts do you know from Rails?

Practice

  • Checkout the repo for the makandra blog Archive
  • Start the preview server
  • Make some changes, review them on localhost:4567...