Difference between render :action and render :template

前端 未结 3 1598
无人及你
无人及你 2020-12-07 16:57

What is the difference between render :action => \"new\" and render :template => \"users/new\"? I have heard that rendering template, we can

3条回答
  •  萌比男神i
    2020-12-07 17:35

     render :action => 'some_controller_action', :layout => 'some_layout_in_layout_folder'
    

    will render the view of that controller action and apply the asset settings (javascript, CSS) of the some_layout_in_layout_folder layout.

    If you write this in a controller action, it will use the styling of the specified layout in conjunction with any layout defined at the beginning of the class, if any

提交回复
热议问题