0

In my Controller I have

MessageContent.new(language: "en", body: "Write your english text here", title: "", sender: "Admin")

and in view, I want to add the body as placeholder to my input

 = f.input :body

I have been searching for the answer, but no clue. Thx

ishwr
  • 725
  • 3
  • 14
  • 36

1 Answers1

1

This should work

# controller
@message_content = MessageContent.new(language: "en", body: "Write your english text here", title: "", sender: "Admin")

# view
= f.input :body, placeholder: @message_content.body
Eyeslandic
  • 14,553
  • 13
  • 41
  • 54