Flowdock

42 results found for "blank?"

validates_presence_of

(ActiveRecord::Validations::ClassMethods, >= v1.0.0 <= v6.0.0)
Importance_3_sm

blank (as defined by Object#blank?), and, if the attribute is an association, that the associated object is not marked for destruction. Happens by default on save. The face attribute must be in the object and it cannot be blank or marked for destruction. If you want to validate the presence

validates_presence_of

(ActiveModel::Validations::HelperMethods, >= v3.0.0 <= v6.0.0)
Importance_3_sm

blank (as defined by Object#blank?). Happens by default on save. The first_name attribute must be in the object and it cannot be blank. If you want to validate the presence of a boolean field (where the real values are true and false ), you will want to use validates

where

(ActiveRecord::QueryMethods, >= v3.0.0 <= v6.0.0)
Importance_5_sm

without additional arguments, is passed to the query constructor as an SQL fragment, and used in the where clause of the query. See WhereChain for more details on #not. blank condition If the condition is any blank-ish object, then #where is a no-op and returns the current relation.

validates_absence_of

(ActiveModel::Validations::HelperMethods, >= v4.0.2 <= v6.0.0)
Importance_1_sm

blank (as defined by Object#blank?). Happens by default on save. The first_name attribute must be in the object and it must be blank. Configuration options: :message - A custom error message (default is: “must be blank”). There is also a list of default options supported by every validator: :if, :unless

date_select

(ActionView::Helpers::DateHelper, >= v1.0.0 <= v6.0.0)
Importance_5_sm

blank - Include a blank option in every select field so it’s possible to set empty dates. :default - Set a default date if the affected date isn’t set or is nil . :selected - Set a date that overrides the actual value. :disabled - Set to true if you want show the select

ActionView::Helpers::FormOptionsHelper

Importance_3_sm

tags. The collection_select, select and time_zone_select methods take an options parameter, a hash: :include_blank - set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element.

select_tag

(ActionView::Helpers::FormTagHelper, >= v1.0.0 <= v6.0.0)
Importance_5_sm

blank - If set to true, an empty option will be created. If set to a string, the string will be used as the option’s content and the value will be empty. :prompt - Create a prompt option with blank value and the text asking user to select something. Any other

select

(ActionView::Helpers::FormOptionsHelper, >= v1.0.0 <= v6.0.0)
Importance_5_sm

blank value. Note: The client either sends only the hidden field (representing the deselected multiple select box), or both fields. This means that the resulting array always contains a blank string. In case if you don’t want the helper to generate this hidden field you can specify include_hidden

blank?

(Object, >= v2.0.3 <= v6.0.0)
Importance_2_sm

An object is blank if it’s false, empty, or a whitespace string. For example, false, ”, ‘ ’, nil, [], and {} are all blank. This simplifies @return [true, false]

blank?

(String, >= v2.1.0 <= v6.0.0)
Importance_1_sm

A string is blank if it’s empty or contains whitespaces only: @return [true, false]

validates_length_of

(ActiveModel::Validations::HelperMethods, >= v3.0.0 <= v6.0.0)
Importance_3_sm

blank - Attribute may be blank; skip validation. :too_long - The error message if the attribute goes over the maximum (default is: “is too long (maximum is %{count} characters)”). :too_short - The error message if the attribute goes under the minimum (default is: “is too short (minimum is %{count} characters)”). :wrong

accepts_nested_attributes_for

(ActiveRecord::NestedAttributes::ClassMethods, >= v2.3.2 <= v6.0.0)
Importance_5_sm

blank instead of a Proc will create a proc that will reject a record where all the attributes are blank excluding any value for _destroy . :limit Allows you to specify the maximum number of associated records that can be processed with the nested attributes. Limit also can be specified as a Proc

validates_each

(ActiveModel::Validations::ClassMethods, >= v2.1.0 <= v6.0.0)
Importance_3_sm

blank - Skip validation if attribute is blank. :if - Specifies a method, proc or string to call to determine if the validation should occur (e.g. if: :allow_validation, or if: Proc.new { |user| user.signup_step > 2 } ). The method, proc or string should return or evaluate to a true or false value

blank?

(Numeric, >= v2.1.0 <= v6.0.0)
Importance_1_sm

No number is blank: @return [false]

blank?

(Date, >= v5.0.0.1 <= v6.0.0)
Importance_1_sm

No Date is blank: @return [false]

blank?

(Time, >= v5.0.0.1 <= v6.0.0)
Importance_1_sm

No Time is blank: @return [false]

blank?

(TrueClass, >= v2.1.0 <= v6.0.0)
Importance_1_sm

true is not blank: @return [false]

blank?

(DateTime, >= v5.0.0.1 <= v6.0.0)
Importance_1_sm

No DateTime is ever blank: @return [false]

blank?

(FalseClass, >= v2.1.0 <= v6.0.0)
Importance_1_sm

false is blank: @return [true]

blank?

(NilClass, >= v2.1.0 <= v6.0.0)
Importance_1_sm

nil is blank: @return [true]

check_if_method_has_arguments!

(ActiveRecord::QueryMethods, >= v4.0.2 <= v6.0.0)
Importance_1_sm

Checks to make sure that the arguments are not blank. Note that if some blank-like object were initially passed into the query method, then this method will not raise an error. Example: end

collection_radio_buttons

(ActionView::Helpers::FormOptionsHelper, >= v4.0.2 <= v6.0.0)
Importance_3_sm

prevent this the helper generates an auxiliary hidden field before every collection of radio buttons. The hidden field has the same name as collection radio button and blank value. In case if you don’t want the helper to generate this hidden field you can specify include_hidden: false option.

collection_check_boxes

(ActionView::Helpers::FormOptionsHelper, >= v4.0.2 <= v6.0.0)
Importance_3_sm

field generated by the helper method for every collection of checkboxes. This hidden field is given the same field name as the checkboxes with a blank value. In the rare case you don’t want this hidden field, you can pass the include_hidden: false option to the helper method.

blank?

(ActiveSupport::TimeWithZone, >= v5.0.0.1 <= v6.0.0)
Importance_1_sm

An instance of ActiveSupport::TimeWithZone is never blank

grouped_collection_select

(ActionView::Helpers::FormOptionsHelper, >= v2.3.8 <= v6.0.0)
Importance_3_sm

blank in the options hash. Parameters: object - The instance of the class to be used for the select tag method - The attribute of object corresponding to the select tag collection - An array of objects representing the <optgroup> tags. group_method - The name of a method which, when called

blank?

(ActiveRecord::Relation, >= v4.0.2 <= v6.0.0)
Importance_1_sm

Returns true if relation is blank.

validates_format_of

(ActiveModel::Validations::HelperMethods, >= v3.0.0 <= v6.0.0)
Importance_3_sm

that match the beginning or end of lines as opposed to the beginning or end of the string. These anchors are ^ and $ . There is also a list of default options supported by every validator: :if, :unless, :on, :allow_nil, :allow_blank, and :strict . See ActiveModel::Validations#validates for more information

collection_select

(ActionView::Helpers::FormOptionsHelper, >= v1.0.0 <= v6.0.0)
Importance_5_sm

blank in the options hash. The :value_method and :text_method parameters are methods to be called on each member of collection . The return values are used as the value attribute and contents of each <option> tag, respectively. They can also be any object that responds to call

ActionController::Helpers

Importance_2_sm

config.action_controller.include_all_helpers to false . Additional helpers can be specified using the helper class method in ActionController::Base or any controller which inherits from it. The to_s method from the Time class can be wrapped in a helper method to display a custom message if a Time object is blank:

password_field

(ActionView::Helpers::FormHelper, >= v1.0.0 <= v6.0.0)
Importance_2_sm

options on the input tag can be passed as a hash with options . These options will be tagged onto the HTML as an HTML element attribute as in the example shown. For security reasons this field is blank by default; pass in a value via options if this is not desired. Examples