Recent notes
RSS feed
Moved from ActiveRecord to ActiveModel
Don’t let the depreciation warning scare you, Dirty lives under ActiveModel as of 3.0.0
apidock.com/rails/ActiveModel

Returns a string used for submit button label
This private method returns the label used for the `f.submit` helper.
apidock.com/rails/v5.2.3/ActionView/Helpers/FormBuilder/submit
<%= form_for @post do |f| %> <%= f.submit %> <% end %>
In the example above, if @post is a new record, this method returns “Create Post” as submit button label; otherwise, it uses “Update Post”.
This method also checks for custom language using I18n under the helpers.submit key and using %{model} for translation interpolation:
en: helpers: submit: create: "Create a %{model}" update: "Confirm changes to %{model}"
It also searches for a key specific to the given object:
en: helpers: submit: post: create: "Add %{model}"

Access just the label text
One of the handiest features of `f.submit` is the auto-generated label text.
Some styling frameworks don’t lend themselves to using `f.submit` without lots of tweaking.
If you’re not using `f.submit` but still want to access the label text, note that there is a private method:
f.send(:submit_default_value)
One example (in Haml, using MaterializeCss):
.row .col.s6.center %button{ type: 'submit', name: 'commit', data: { disable: { with: 'Submitting...' } }, class: 'waves-effect waves-light btn maroon' } = f.send(:submit_default_value)

Text improvement
The statement about not loading a bunch of records is correct because pluck returns an Array of values, not a ActiveRecord::Relation or an Array of Records.
The exact wording though may be:
“…without retrieving from the database unused columns or loading a bunch of records just to grab the attributes you want”

Mr.
555

Mr.
555

Mr.
555

Mr.
0“XOR(if(now()=sysdate(),sleep(15),0))XOR”Z

Mr.
555

Mr.
555

Mr.
555

Mr.
0’XOR(if(now()=sysdate(),sleep(15),0))XOR’Z

Mr.
555

Mr.
555

Mr.
if(now()=sysdate(),sleep(15),0)

Mr.
555

Mr.
555

Mr.
555

Mr.
555

Mr.
-1“ OR 2+57-57-1=0+0+0+1 –

Mr.
555

Mr.
-1’ OR 2+987-987-1=0+0+0+1 or ‘dHwoMbvJ’=‘

Mr.
555

Mr.
555

Mr.
-1’ OR 2+887-887-1=0+0+0+1 –

Mr.
555

Mr.
555

Mr.
555

Mr.
555

Mr.
555