Alice's tech diary


Journey towards web development

Some tiny warnings when adding the Devise Gem to your application

Once you know how to implement a user authentication, it can be a bit tiring to do all the steps - to create the models, views, controllers, validations…, especially knowing that there is a gem that can do that for you. So Devise can handle all the user authentication as a whole. In only a few steps, the gem will create everything for you and you will just to customise it a little.


Installing Bootstrap in a Rails application

Introduction


Sinatra project: MenuCMS and what I learned

Introduction

The MenuCMS is a small application using Sinatra framework and offers to help small restaurant teams to submit menus ideas and choose a menu to publish to the restaurant webpage.


Sinatra Portfolio project - Database design

Problem and introduction

The project

The project I will be working on is a small CMS to help small restaurants to manage their menus. The application will allow a restaurant team to submit menus ideas and select the one that is going to be published on the website. Each menu is composed of several meals. Therefore:

  • The users will be able to create meals and to add meals to a menu.
  • The user whose role is “Manager” will be able to publish the menu on the website.
  • Each user will be able to delete their own menus but not the others’.

Active Record: cheatsheet and notes on migrations

What is Active Record and how does it work?

Active Record is a Ruby library that provides an Object relational Mapping (ORM). Columns are accessed by methods, and integrates SQL queries in its available pre-made methods. It also provides methods for the four basic functions create, read, update and delete (CRUD). The main object of Active Record is to “map” the table columns to the corresponding object attributes of your database. It is called a design pattern.