macOS 10.15.4 Ruby 2.7.1 Rails 6.0.3.1 Yarn 1.22.4 Node 13.12.0
rails new app_name cd app_name
| func factorial(n : Int) -> Int { | |
| if (n > 0) { | |
| return n * factorial(n - 1) | |
| } else { | |
| return 1 | |
| } | |
| } | |
| factorial(20) |
| { | |
| "AWSTemplateFormatVersion" : "2010-09-09", | |
| "Description" : "Mail server for receiving", | |
| "Parameters" : { | |
| "MailServerDomain" : { | |
| "Type" : "String", | |
| "Default" : "mail.example.com", | |
| "Description" : "mail server domain" | |
| }, |
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Runtime.InteropServices; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace TestCtrlEvent |
| // This file is automatically compiled by Webpack, along with any other files | |
| // present in this directory. You're encouraged to place your actual application logic in | |
| // a relevant structure within app/javascript and only use these pack files to reference | |
| // that code so it'll be compiled. | |
| require("@rails/ujs").start() | |
| require("turbolinks").start() | |
| require("@rails/activestorage").start() | |
| require("channels") | |
| require("./application.scss") |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Tailwind CSS Modal</title> | |
| <link href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <div class="flex flex-col"> | |
| <div class="bg-blue-500 m-3 py-20 px-4">text</div> |
| # frozen_string_literal: true | |
| class Bicycle | |
| attr_reader :size, :chain, :tire_size | |
| def initialize(**kwargs) | |
| @size = kwargs[:size] | |
| @chain = kwargs[:chain] || default_chain | |
| @tire_size = kwargs[:tire_size] || default_tire_size | |
| post_initialize(**kwargs) |
| # frozen_string_literal: true | |
| class Trip | |
| def prepare(preparers) | |
| # ... | |
| preparers.each do |preparer| | |
| preparer.prepare_trip(foo: self) | |
| end |
| # メッセージコントローラに下書き用のコントローラを追加する。 | |
| # サブリソースのフィルタリング index # 下書き一覧を表示する | |
| # サブリソースのアクション create # 下書きにする、destroy # 清書にする | |
| # confing/routes.rb | |
| Rails.application.routes.draw do | |
| namespace :messages do | |
| resources :drafts, only: :index | |
| end | |
| resources :messages do | |
| resource :draft, only: %i[create destroy], module: 'messages' |
| module ApplicationHelper | |
| def form_data_window_confirm(message) | |
| { | |
| 'data-controller' => 'window_confirm', | |
| 'data-window_confirm-message-value' => message, | |
| 'data-action' => 'window_confirm#show' | |
| } | |
| end | |
| end |