Rails: storing erb templates in database

后端 未结 3 1012
死守一世寂寞
死守一世寂寞 2020-12-17 02:20

Is it possible to store erb templates in database? How?

3条回答
  •  借酒劲吻你
    2020-12-17 02:45

    I found better way:

    def show
      @modal_popup = ModalPopup.find(params[:id])
      # erb = ERB.new(@modal_popup.content)
      # render :text => erb.result, :layout => false
      render :inline => @modal_popup.content, :layout => false
    end
    

    I use this action inside iframe or render the action from another views.

提交回复
热议问题