I've noticed that Ruby on Rails code has 2 spaces indentation, e.g.:
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
...
t.timestamps
end
end
...
end
Is this a convention to have 2 spaces ? (I've used to indent with Tab, which is usually 4 spaces.)
Bonus: Does anyone know how to change the Tab size from 4 spaces to 2 spaces in e text editor?
Yes, two spaces per indentation level is the Ruby community standard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With