Passing local variables to a view from controller

后端 未结 5 877
鱼传尺愫
鱼传尺愫 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:25

    You can get it as follows. All gives the same result. Here is the reference link.

    render action: :show , locals: { resource: "Some text"}
    render :show , locals: { resource: "Some text"}
    render locals: { resource: "Some text"}
    

提交回复
热议问题