Reputation: 2165
For example:
x = "Hi my name is params[:name]"
or
x= "Hi my name is params[:name] and my favorite color is params[:color]"
I want to use one controller for a whole bunch of simple text request/responses but they might have unpredictable parameters.
Upvotes: 0
Views: 56
Reputation: 44581
You can interpolate variables in strings like this in ruby:
x = "Hi my name is #{params[:name]} and my favorite color is #{params[:color]}"
Upvotes: 1