views:

15

answers:

1

How can I print data, usually html, in erb? Sometimes it is just impossible to do everything in the controller, like so

print "you are funny" in a red div, with a big structure

and

print "you are hilarious" in a blue div with simple structure

I cannot store them in a variable in the controller n then print it in erb

and the <%= %> tags dont work over multiple lines of code, they only print the last result of the last line in block. Are there any other methods?

A: 

Type script/generate scaffold Post name:string title:string content:text in new rails app and study generated .html.erb files.

Or, better yet, start with some rails tutorial.

Nikita Rybak