Install: https://icons.getbootstrap.com/ As a font face
yarn add bootstrap-icons
Then update application.scss
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
lazy var persistentContainer: NSPersistentContainer = { | |
let container = NSPersistentContainer(name: "DataModel") | |
container.loadPersistentStores(completionHandler: { (storeDescription, error) in | |
if let error = error as NSError? { | |
fatalError("Unresolved error \(error), \(error.userInfo)") | |
} | |
}) |
import React, { useRef, useState, useEffect } from "react"; | |
const useForm = ({ initialValues, onSubmit }) => { | |
const [values, setValues] = useState(initialValues || {}); | |
const [errors, setErrors] = useState({}); | |
const [touched, setTouched] = useState({}); | |
const [onSubmitting, setOnSubmitting] = useState(false); | |
const [onBlur, setOnBlur] = useState(false); | |
const formRendered = useRef(true); |
Install: https://icons.getbootstrap.com/ As a font face
yarn add bootstrap-icons
Then update application.scss
# post.cr | |
class Post | |
YAML.mapping({ | |
name: String, | |
description: String, | |
}) | |
end | |
# factory.cr | |
module Factory |
/* | |
* Sample API with GET and POST endpoint. | |
* POST data is converted to string and saved in internal memory. | |
* GET endpoint returns all strings in an array. | |
*/ | |
package main | |
import ( | |
"encoding/json" | |
"flag" |
# Generate a response array consistent with the requirements of the SPEC. | |
# @return [Array] a 3-tuple suitable of `[status, headers, body]` | |
# which is suitable to be returned from the middleware `#call(env)` method. | |
def finish(&block) | |
if STATUS_WITH_NO_ENTITY_BODY[status.to_i] | |
delete_header CONTENT_TYPE | |
delete_header CONTENT_LENGTH | |
close | |
return [@status, @headers, []] | |
else |
See also: https://blog.robsdomain.com/twitter-bootstrap-in-rails-6/
Rails 6 mades large changes to how asset compilation is done. In specific sprockets
has been removed for javascript processing and replaced with the common webpack
utility. Sprockets remains in usage for CSS processing.
When it comes to asset bundling, the "Rails way" is webpack for JavaScript and Sprockets for everything else. The default setup in a fresh Rail 6 install, similar to what Basecamp uses, still compiles CSS, images, and fonts with Sprockets.
This means, if you're a member of the Basecamp camp, all your webpack JavaScript source files would live in app/javascript and all your Sprockets CSS and images would remain in app/assets. Running rails assets:precompile will first build all the Sprockets assets into the public/assets directory, then will build all the webpack assets into the public/packs directory.
Software | Version | What Is It? |
---|---|---|
Node Version Manager (nvm) | latest | A Node.js version management software |
Node.js | v10.11.0 | An open source Javascript runtime. |
Yarn | latest | A node package manager tool |
Vue CLI | 3.10.0 | Vue JS command line interface for serving and generating applications |