Rails view helpers in helper file

后端 未结 3 2205
星月不相逢
星月不相逢 2020-12-13 20:27

I\'m probably missing something obvious here but here\'s what I\'m trying to do.

From the view, I\'m calling a custom helper function

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 21:06

    As it turns out, I had to do something like this

    def display_services
      html = "
    " html << (form_for @user do |f| f.text_field ... end) html << "
    " end

    Note the () wrapped around the form block. If someone has a better solution, let me know.

提交回复
热议问题