0

I'm trying to render the following in my controller:

User-agent: *
Disallow: /

Currently it looks like this:

User-agent: *Disallow: /

def robots
  output = "User-agent: *\nDisallow: /"   #this is wrong I know...
  render text: output
end

How can I include the newline character?

Dave Schweisguth
  • 34,335
  • 10
  • 90
  • 114
Blankman
  • 248,432
  • 309
  • 736
  • 1,161

1 Answers1

1

Make sure that you use double quotes render :text => "User-agent: *\nDisallow: /"

Jim Edelstein
  • 792
  • 7
  • 10