Ruby question about # Signs

前端 未结 2 1219
隐瞒了意图╮
隐瞒了意图╮ 2021-01-17 05:53

As seen here: http://railstutorial.org/chapters/rails-flavored-ruby#top for the file:

app/helpers/application_helper.rb:

module ApplicationHelper

           


        
2条回答
  •  深忆病人
    2021-01-17 06:34

    It's string interpolation. Eg:

    name = "nobosh"
    puts "Hello, #{name}."
    

    Prints

    Hello, nobosh.

提交回复
热议问题