Passing ActionView::Helpers::FormBuilder to a partial

前端 未结 3 1131
渐次进展
渐次进展 2021-01-05 01:01

I am atempting to dinamically create form elements given a certain AJAX request.

This is my setup:

View:

    <%= link_to \'Next\', check_         


        
3条回答
  •  长发绾君心
    2021-01-05 01:28

    For anyone needing to build a form builder in the controller, view_context still works there. Using Rails 4.1.4:

    @object = Object.new
    @f = ActionView::Helpers::FormBuilder.new(:object, @object, view_context, {})
    

提交回复
热议问题