Rails Application Templates

How do you start a new Rails project? As the very first guide we do like this: 1 rails new blog -d postgresql After that, you add some essentials gems and configuration, init Devise, add user controller… Devise: for authentication. Fiago: manage env variable. Replace Minitest by RSpec. etc… And then a new project comes, will you do the same? I think the answer is NO right?

Sanitizing params in Rails

The problem: Here is the example of data which POST from a client to API endpoint: 1 2 3 4 5 6 7 8 9 { "data": { "type": "entry", "attributes": { "title": " Chassidy Kozey re ", "content": " \n test n tag and spaces \n another " } } } In the content, there are whitespaces in the leading, trailing and, middle. Expectation: The spaces and the whitespaces should be removed from the leading and trailing.

How to override Bootstrap badge color

Html structure 1 2 3 4 5 td.sm-down-hidden - if payment? span.badge.badge-pill.badge-payment--verified = 'verified' - else span.badge.badge-pill.badge-payment--pending = 'pending' What does not work 1 2 3 4 5 6 7 8 9 10 11 12 .badge-payment { &--verified { background: $verified-background; color: $verified-color; } &--pending { background: $pending-background; color: $pending-color; } } What work 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .