- Generate new rails app using
--webpackflag
rails new myApp --webpack=vueNote:
- You can use
--webpack=angularfor angular application and--webpack=reactfor react.
| import { Controller } from "@hotwired/stimulus"; | |
| import * as bootstrap from "bootstrap"; | |
| export default class extends Controller { | |
| connect() { | |
| new bootstrap.Toast(this.element).show(); | |
| } | |
| } |
| computed: { | |
| sortedArray() { | |
| let sortedRecipes = this.recipes; | |
| sortedRecipes = sortedRecipes.sort((a,b) => { | |
| let fa = a.title.toLowerCase(), fb = b.title.toLowerCase(); | |
| if (fa < fb) { | |
| return -1 | |
| } | |
| if (fa > fb) { |
| {% comment %} | |
| * | |
| * This loop loops through a collection called `collection_name` | |
| * and sorts it by the front matter variable `date` and than filters | |
| * the collection with `reverse` in reverse order | |
| * | |
| * To make it work you first have to assign the data to a new string | |
| * called `sorted`. | |
| * | |
| {% endcomment %} |
initialize: once, when the controller is first instantiatedconnect: anytime the controller is connected to the DOM| <?php | |
| /** | |
| * If the aria-label argument has been specified in a wp_dropdown_categories() call, | |
| * output the aria-label option in the <select> | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param string $output HTML Output | |
| * @param array $arguments wp_dropdown_category() arguments | |
| * @return string Modified HTML Output |
| <% flash.each do |type, message| %> | |
| <div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
| <button class="close" data-dismiss="alert">×</button> | |
| <%= message %> | |
| </div> | |
| <% end %> |
| [alias] | |
| co = checkout | |
| cob = checkout -b | |
| com = checkout master | |
| br = branch | |
| brd = branch -d | |
| dmerged = "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" | |
| st = status -sb | |
| aa = add -A . | |
| cm = commit |