Elias7
Elias7

Reputation: 12861

Titles in Embedded Ruby

I'm a newbie to Ruby on Rails, and was wondering, I currently define the title as:

<% provide(:title, @user.first_name) %>

If I wanted to add @user.last_name to that string, how could I do so?

Thank you!

Upvotes: 0

Views: 46

Answers (1)

DanS
DanS

Reputation: 18463

You can concatenate strings with the + operator:

<% provide(:title, @user.first_name + " " + @user.last_name) %>

Upvotes: 1

Related Questions