条件を指定して検索しています。すべての条件を解除する
3日前 -※背番号(number)属性と名前(name)属性に「presence: true」を指定することで背番号と名前に「空を禁止(値を必ず入れなければいけない)」という制限を加えた。
5日前 -I am trying to give my model User a default avatar image whenever they create new account or their username is updated: # frozen_string_literal: true class ...
19時間前 -When submitting an order, there are two fields to select the customer and the product. However, the logs (and db) show that the customer (customer.email) and ...
2日前 -Let's take the kind of straightforward method of doing this and consider it in the context of REST and Ruby on Rails, with a simple "todo list" application.
4日前 -We put some validations on this to make sure we don't have any typos or invalid events. actor : the user that performed the action. We also have a “system” user ...
5時間前 -【Rails】gem geocoderを使用する際のバリデーションについて. Ruby · Rails ... validates :address, presence: true validates :latitude, presence: true validates ...
Q.Ruby on Railsのvalidatesの使い方について。 同ユーザーの同回答を防ぐためにvalidatesのuniqunessを使用していますが、これだと他のユーザーにも制限がかかってし...
A.回答を一意にするUserなのかどうかを判別するフラグを新たに持たせて、それをwith_optionsメソッドで判定すればいいです。 以下を参考にしてください。 Railsで特定の条件下で走る...
Q.Ruby On Rails のバリデーションに関する質問です。 validates を、メソッド内ではなく、クラスの直下で定義していますが、validates はプロパティなのでしょうか? それ...
A.validates は ActiveModel::Validations モジュールで 定義されてる特異メソッドで ActiveRecord::Base などの フィールドをチェックします。 今...
Q.個人でRubyでwebアプリを開発しています。 セキュリティについて不安があります。 そのwebアプリは動画販売サービスです。 クレジットカードはトークンを使用して支払いなどをするので安全だと...
A.データベースより前に、フロントエンドの脆弱性対策が先だと思います。 まずは、無料のツールを使ってみてはいかがですか。 https://yun-craft.com/admin-blog/tomiz...
5日前 -Defines data and business rules. ```ruby # app/models/user.rb class User < ApplicationRecord has_many :repositories validates :name, presence: true validates : ...
1日前 -... validates, builds, scales, maintains, and supports web and mobile products ... Privately Held. Founded: 2003. Specialties: user experience design, ruby on rails ...
1日前 -Williams discusses the different operations hooked in Ruby, introduces the fiber scheduler, and talks about the importance of characterizing performance issues ...
4日前 -Rails 5でログインフォームを実装する. サンプルコードで学ぶRuby on Rails ... validates :password, presence: true, length: { minimum: 6 } end. ユーザー登録 ...