- Generate new rails app using
--webpack
flag
rails new myApp --webpack=vue
Note:
- You can use
--webpack=angular
for angular application and--webpack=react
for react.
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 %> |
async function fetchAndUpdatePosts() { | |
const posts = await fetchPosts().catch(() => { | |
console.log('error in fetching posts'); | |
}); | |
if (posts) { | |
doSomethingWithPosts(posts); | |
} | |
} |
# .railsrc | |
-B #Skip Bundle | |
-T #Skip Test-Unit | |
-d postgresql #Use postgres |