Passing local variables to a view from controller

后端 未结 5 879
鱼传尺愫
鱼传尺愫 2021-02-14 05:57

I am not able for some reason to pass local variables to the show view...

In my controller i have simply:

def show
  render template: \"books/show\", :re         


        
5条回答
  •  孤街浪徒
    2021-02-14 06:27

    I think it should be like

    render 'books/show', :locals => {:resource => 'Some text'}

    It works for me

提交回复
热议问题