3 ms·
Symbols in Ruby are basically concise strings, :id is a symbol, "id" a string. There are some differences of how they are allocated but it's mainly a style pref
by aboutruby 8y ago
Symbols in Ruby are basically concise strings, :id is a symbol, "id" a string. There are some differences of how they are allocated but it's mainly a style preference and a convention.
e.g. you would typically do { id: 1, name: "aboutruby" } where id and name are symbols, instead of { "id" => 1, "name" => "aboutruby" } with strings.
But really I don't see the point of removing the symbols.