Asked • 03/18/19

Convert string to symbol-able in Ruby?

Symbols are usually represented as such :book_author_titlebut if I have a string: "Book Author Title"is there a built in way in rails/Ruby to convert it into a symbol where I can use the `:` notation without just doing a raw string regex replace?

1 Expert Answer


Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.