Heredocs and how to use them in Ruby and Rails
09-Apr-2020 1505
Heredoc allows us to specify a string as a block of texts where new lines and indentations are maintained.This is useful in Ruby for various cases like specifying multiline text strings, multiline method dynamic definitions and more.There many ways to use Heredoc in Ruby and in Rails, with diferent utilities. This can be confusing at times where to use which version. Lets do a run-down of different ways to use it.
Heredocs and how to use them in Ruby and Rails #ruby #rubydeveloper #rubyonrails #Heredocs #Rails https://rubyonrails.ba/link/heredocs-and-how-to-use-them-in-ruby-and-rails