Name | Singular/Plural | Use |
---|---|---|
Controller | Plural | rails g controller Users index show |
Helper | Plural | rails g helper Users |
Mailer | Singular | rails g mailer UserMailer |
Migration | Plural | rails g migration AddEmailToUsers email:string |
Model | Singular | rails g model User name:string |
Observer | Singular | rails g observer User |
Resource | Plural* | resources :users, :only => [:index, :show] |
Scaffold | Singular | rails g scaffold User name:string |
$ > sudo mysql -uroot
mysql > SELECT User, Host FROM mysql.user;
mysql > DROP USER 'root'@'localhost';
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller } from "stimulus" | |
import { DirectUpload } from "@rails/activestorage" | |
import Dropzone from "dropzone" | |
import { getMetaValue, findElement, removeElement, insertAfter } from "helpers" | |
Dropzone.autoDiscover = false | |
export default class extends Controller { | |
static targets = [ "input" ] |
It is loaded by default by /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist.
If you run
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See how variables work, and a list of predefined ones: | |
# - https://docs.gitlab.com/ce/ci/variables/ | |
variables: | |
RAILS_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/railsapp:$CI_COMMIT_SHA | |
NGINX_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/nginx:$CI_COMMIT_SHA | |
DEPLOY_TAG: $CI_COMMIT_SHA | |
cache: | |
paths: | |
- vendor/ruby |
- The History
- Why does it exist?
- Bike Shedding/LookingFor
- Do we have to use it?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = window.location; | |
var element = $(".ui.vertical.menu a.item").filter(function() { | |
return this.href == url || url.href.indexOf(this.href) == 0; | |
}).addClass("active").parent().parent().parent(); | |
if (element.is("li")) { | |
element.addClass("active"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% [:notice, :error, :alert].each do |level| %> | |
<% unless flash[level].blank? %> | |
<div data-alert="alert" class="alert alert-<%= flash_class(level) %> fade in"> | |
<a class="close" data-dismiss="alert" href="#">×</a> | |
<%= content_tag :p, flash[level] %> | |
</div> | |
<% end %> | |
<% end %> |
I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api
Rails.application.routes.draw do
constraints subdomain: "api" do
scope module: "api" do
NewerOlder