gem 'simple_form'
rails generate simple_form:install
L1 | |
Базовые знание диалекта Typescript, основных встроенных примитивов (Array, Object, Function, String, Date) и методов работы с ними, понимание контекста (this) и способов управления им | |
Базовые знания фреймворка React | |
Знание наиболее часто используемых Web API: fetch/XHR, Storage, PostMessage, DOM | |
Умение писать простейшие алгоритмы (поиск, сортировка, сравнение объектов) без требований к их оптимальности. | |
Навыки кроссбраузерной адаптивной верстки по макету с использованием существующего кода, знание CSS и препроцессора SCSS | |
Навыки отладки разметки в браузерах Chrome/Safari | |
Знание принципов работы HTTP, отличий между различными методами, принципов работы Cookies | |
Практическое владение лучшими практиками структурирования кода: SOLID/DRY/KISS и т.д. | |
Базовые знания git, понимание git flow |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
By default, Rails applications build URLs based on the primary key -- the id
column from the database. Imagine we have a Person
model and associated controller. We have a person record for Bob Martin
that has id
number 6
. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6
here, is called the "slug". Let's look at a few ways to implement better slugs.
# before (legacy model) | |
# app/models/user.rb | |
class User < ActiveRecord::Base | |
validates :name, length: { maximum: 100 } | |
validates :lastname, length: { maximum: 100 } | |
validates :patronymic, length: { maximum: 100 } | |
before_save :capitalize_name!, :if => :name_process_needed? | |
private |
(1..5).include?(2..3) # => false | |
require 'active_support/all' | |
(1..5).include?(2..3) # => true |
# Keep in mind that when asking for a `return` after another, only the first one will be output. | |
# This example is meant as a simple starting point, to show how to get the information in the simplest available way. | |
# Google Chrome | |
tell application "Google Chrome" to return URL of active tab of front window | |
tell application "Google Chrome" to return title of active tab of front window | |
# Google Chrome Canary | |
tell application "Google Chrome Canary" to return URL of active tab of front window | |
tell application "Google Chrome Canary" to return title of active tab of front window | |
# Chromium |
==== General Organizational Principles for CSS and JS in Rails | |
=== Framework requirements | |
1. Modularity | |
2. Complex components are built from simple, atomic components | |
3. Cross-browser compatibility | |
a. Follow W3C standards | |
b. Keep IE hacks in a separate style file | |
4. Bulletproof |
<%= init_fb_connect('XFBML', :js => :jquery) %> |
This is how you can do truly semantic clearfixing easily in Sass.
The @extend directive is used to inherit the .group class for other selectors. Sass takes care of spreading the selectors around for you.