Can i render :partial a view without leading underscore?

后端 未结 3 686
梦如初夏
梦如初夏 2021-02-05 01:18

i am facing a precarious condition here. I need to partially render a page that does not have a leading underscore.

<%= render(:partial => \"contact\" ,:co         


        
3条回答
  •  长情又很酷
    2021-02-05 01:59

    As eteubert points out, one of the strengths of Rails is its opinionated nature. What you are trying to do here is bend that to your will. Don't. If you need to render something in another page as a partial, then you really should follow convention and extract a partial from the original page. If there's a form in that page for example, extract it out into a partial and have the original page render the partial as well.

    You'll find the less you try to fight Rails, the easier things become.

提交回复
热议问题