Question

I am working back through the "Ruby on Rails 3 Tutorial" and trying to understand the syntax at a deeper level. Here is some example code from a helper action that I have defined:

module ApplicationHelper

  def title
    base_title = "Mega Project"
    if @title.nil?
      base_title
    else
      "#{base_title} | #{@title}"
    end
  end

end

My question is about the line: "#{base_title} | #{@title}"

What exactly is going on with the structure of this line?

On a higher level, where is the go-to source to look up things like this?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top