Products Communications Messaging Send and receive multichannel text and media messages in 180+ countries
タグ検索の該当結果が少ないため、タイトル検索結果を表示しています。
Attributes and properties are fundamentally different things. You can have an attribute and property of the same name set to different values. For example: <div foo="bar">…</div> <script> const div = document.querySelector('div[foo=bar]'); console.log(div.getAttribute('foo')); // 'bar' console.log(div.foo); // undefined div.foo = 'hello world'; console.log(div.getAttribute('foo')); // 'bar' consol
2019.11.05 週刊Railsウォッチ(20191105前編)Rails 6のデフォルト設定解説、DHHも消したいaccepts_nested_attributes_for、スライド『実践Railsアプリケーション設計』ほか こんにちは、hachi8833です。今年の3連休は昨日のでおしまいだそうです。 実を言うと今年の祝日はもうだめです。 突然こんなこと言ってごめんね。 でも本当です。 この週末から月曜にかけて 3連休が来ます。 それが終わりの合図です。 3週間後に土曜日に潰される祝日が来るので 気をつけて。 それが過ぎたら、もう今年が終わるまで 祝日はありません。 — usa (@unak) November 1, 2019 各記事冒頭には⚓でパーマリンクを置いてあります: 社内やTwitterでの議論などにどうぞ 「つっつきボイス」はRailsウォッチ公開前ドラフトを(鍋のよう
By default, an <img> takes up zero space until the browser loads enough of the image to know its dimensions: When you run the demo, you'll see the <figcaption> immediately. Then, after a few seconds, this paragraph and subsequent page content shifts downwards to make room for the image. This makes the user experience massively frustrating, as content moves out from under the user's eyes/finger/poi
There are many HTML attributes, in addition to some basic attributes, there are many useful and particularly powerful attributes; This article will introduce 24 powerful HTML attributes that can make your website more dynamic and interactive, and make users feel more comfortable and happy. Let’s explore these 24 powerful HTML attributes together! 1. AcceptThe Accept attribute is used to specify a
2020.06.22 週刊Railsウォッチ(20200622前編)AR attributes周りの高速化進む、Active RecordでUNIONクエリを書く、Cable Ready gemほか こんにちは、hachi8833です。GitHub Marketplaceの無料カテゴリを覗いてみたらいろいろありすぎてまごつきました。 "free": GitHub Marketplace · Tools to improve your workflow つっつきボイス:「GitHub Marketplaceをちゃんと見たのは初めてでした」「GitHubリポジトリと連携できるアプリとかアクションとかですね👀」「IDEまであるのね」「エコシステムがあるのはありがたい🙏」「人気も表示して欲しいかなとちょっと思いました」「人気の指標次第では殴り合いが始まりそうですけど😆」「Chrome拡張みた
概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: Automatically cast params with the Rails Attributes API | Boring Rails: Skip the bullshit and ship fast 原文公開日: 2021-02-15 著者: Matt Swanson サイト: Boring Rails 日本語タイトルは内容に即したものにしました。 Railsアプリでは、ロジックを抽出してPORO(Plain-Old Ruby Object)にすることがよく行われます。しかしコントローラでparamsから直接これらのオブジェクトにデータを渡していることも多く、その場合はデータが文字列になってしまいます。 class SalesReport attr_accessor :start_date, :end_date, :min
PHP 8: Attributes As of PHP 8, we'll be able to use attributes. The goal of these attributes, also known as annotations in many other languages, is to add meta data to classes, methods, variables and what not; in a structured way. The concept of attributes isn't new at all, we've been using docblocks to simulate their behaviour for years now. With the addition of attributes though, we now have a f
As the saying goes… history doesn’t repeat itself, but it often rhymes. If you want to create a successful programming language (or at least understand how you might), it’s immensely valuable to learn from others who have done just that. On Go Time #100, Rob Pike and Robert Griesemer (two of Go’s creators) sat down to discuss the language’s success. Here are 5 of the things Rob Pike attributed to
「Rails 子モデル 保存」 とかでググるとたくさんのaccepts_nested_attributes_forを使用した記事をお見かけすると思います。 そんなaccepts_nested_attributes_forですが、いま自分が働いている会社では使用することを禁じられており、なるべくクリーンな実装を心がけるということを日々意識しております。 そんなこともあり、改めて使用してはいけないものの正体を調べてみました。 accepts_nested_attributes_forとは何か 一言でいえば、「親モデルに紐づくレコードの保存を簡単にできるようにするためのもの」 です。 具体例で見てみましょう。 下記に2つモデルがあり、親モデルであるAuthorの作成と同時にそれに紐づくBookモデルのレコードも作成するというイメージです。 Author(著者) Book(本) # 著者モデル c
ここでは、Rails 5.2で導入されたActiveModel::Attributesについて紹介します。RubyのクラスにActiveRecordのカラムのような属性を加えられます。 サンプル: https://github.com/kazubon/blog-rails6-vuejs/blob/master/app/forms/entries/form.rb クラスにActiveModel::ModelとともにActiveModel::Attributesをインクルードします。 class Entries::Form include ActiveModel::Model include ActiveModel::Attributes クラスメソッドattributeに属性名と型を渡すと、attr_accessorと同じように属性が使えるようになります。指定できる型の種類については、Rai
class CreateChoices < ActiveRecord::Migration[5.2] def change create_table :choices do |t| t.references :question, foreign_key: true t.string :content, null: false t.boolean :is_answer t.timestamps end end end 「問題 has many 選択肢s」です。 選択肢テーブルはis_answerという「正答か誤答か」というカラムを持っています。 よって単純なform_withとモデルでは実装できません。フォームに合わせてDB設計を変える、みたいなのは本末転倒です。(私の記事で恐縮ですが、クイズアプリのDB設計に関して、以下記事を書きました) https://qiita.com/kumacke
In this article, Louis Lazaris describes and demonstrates some interesting HTML attributes that you may or may not have heard of and perhaps find useful enough to personally use in one of your projects. In January, Madison Kanna asked her Twitter followers: What are the languages/tech you’re excited to learn or learn more deeply this year? mine: typescript, next.js, react, graphql, solidity, node
この記事の概要 React 18で新しくuseIdというhooksが使えるようになりました。 コンポーネントにWAI-ARIAを導入するにあたって、便利になると思ったのでいくつかのパターンを紹介します。 また、Qiita Engineer Festa 2022の「React 18、あなたならどう使いこなす?」への投稿記事でもあります。 記事を書こうと思った理由——useId登場以前の迷い 実例を紹介する前に、なぜこの記事を書こうと思ったかについて説明します。 例えばaria-labelledbyを使う場合、以下のようになります。 (コードはMDN Docsのaria-labelledbyのページより拝借) <span role="checkbox" aria-checked="false" tabindex="0" aria-labelledby="tac"></span> <span i
Rails 7 has a rich API that allows you to update your ActiveRecord objects in several ways. Some methods have slightly different behavior which can sometimes result in unexpected consequences, so it’s important to understand their differences. Note: This cheat sheet is for Rails 7. See cheat sheets for other versions here: Rails 3 (external link) Rails 4 (external link) Rails 5 Rails 6 Here’s a ch
Extending Gutenberg Core Blocks with Custom Attributes and Controls Extensibility is one of WordPress features that I love the most. From custom filters to actions, now they are applying the same thing with the new Gutenberg Editor. It’s pretty great but aside from the WordPress handbook, there are only few tutorials available for Gutenberg development as of the moment. This is the main reason I’v
はじめに Rails 6.0が今年リリースされようかという今になって、Rails 5.2の新機能であるActiveModel::Attributesの便利さを知りました。 なので、今回は 「ActiveModel::Attributes」について、学んだことをアウトプットしたいと思います。 ActiveRecordの「Attribute API」 今回の話のそもそもの前提として、RailsのActiveRecordにあるAttribute APIという機能を知っておくと、話がわかりやすいと思います。 このAttribute APIがあるおかげで、ActiveRecordを操作する際にクラス属性の型を意識しなくても、指定の型へ変換してくれています。 # Userの属性の型定義 # - is_admin: boolean # - age: integer # - birthday: date
And the start attribute can be added to begin the list at a number other than one, like this: <ol start="2"> <li>Apple</li> <li>Banana</li> <li>Pear</li> </ol> I’m not sure how I never knew about these properties! I guess I can see how they might come in handy in the future. There are plenty of times when we need to break up ordered lists here on CSS-Tricks with things like code blocks and having
OpenTelemetryを使い始めるにあたって、既存の監視ツールからいきなり切り替えることは難しく、基本的には一時的に並行稼働させて様子を見ることになると思います。 これまでmackerel-agentをインストールし、Mackerelにホストとして登録してシステムメトリックを監視していたマシンに、新たにOpenTelemetry Collector+Host Metrics Receiverを導入するケースを考えてみましょう*1。 Resource Detection Processorなどを併用することで、メトリックにホスト名などをResource Attributesとして付与することができます。しかし、比較のためにMackerel上のホストと対応させて眺めるには今一歩情報が足りません。 そこで、ホストにインストールされたmackerel-agentの設定ファイルを読み、Macke
ウェブブラウザで画像が表示できない場合、画像の代わりに「alt属性」と呼ばれる代替テキストが表示されることがあります。基本的に画像に埋め込まれたalt属性は、ソースコードを表示しない限り閲覧することができませんが、エンジニアのPiro氏が作成したFirefox向け拡張機能「Popup ALT Attributes」を使えばページのソースコードを開くことなく画像のalt属性を確認することが可能です。 Popup ALT Attributes – 🦊 Firefox (ja) 向け拡張機能を入手 https://addons.mozilla.org/ja/firefox/addon/popup-alt-attribute/ XUL Apps > Popup ALT Attributes - outsider reflex https://piro.sakura.ne.jp/xul/_popu
Build with Chrome Learn how Chrome works, participate in origin trials, and build with Chrome everywhere.
日本のオンラインストアのデザインにはたくさんの個別要望が寄せられます。配送日の指定を入れたい、のし袋のオプションを入れたい、商品にバリエーション以外のオプションを持たせたい、顧客情報に性別や生年月日を持たせたい、など。 これらのニーズをノーコードで簡単に満たす方法は、そういった機能を提供するShopifyアプリを利用することですが、アプリは便利な一方で、個別の利用料がかかる、上記のようなストアフロントへ機能を提供する場合、そのアプリのパフォーマンスに表示速度が影響を受ける(アプリをたくさん入れたり、重いアプリを入れるとストアの表示速度も遅くなる)といった側面もあります。 そこで次のオプションとして考えられることは、こういった機能を持つテーマをShopifyテーマストアから探すことですが、マーチャントのニーズ(特に日本の商習慣に固有のもの)を全て叶えるテーマを探し出すことは難しいかもしれませ
AWS News Blog New for Identity Federation – Use Employee Attributes for Access Control in AWS When you manage access to resources on AWS or many other systems, you most probably use Role-Based Access Control (RBAC). When you use RBAC, you define access permissions to resources, group these permissions in policies, assign policies to roles, assign roles to entities such as a person, a group of pers
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く