Jump to content

The ultimate community for Ruby on Rails developers.


Photo

render vs render layout in rails 3


  • Please log in to reply
No replies to this topic

#1 johnmerlino

johnmerlino

    Passenger

  • Members
  • 1 posts

Posted 17 April 2014 - 06:38 PM

Initially I made a simple call with render:

render "home/new_dialogue", locals: {:builder => builder, :model => model, :options => options}, &block

 

But the problem was in the associated view, when I made a call to yield, it didn't yield to the block passed to render.

 

So then I tried with render layout:

 

render layout: "home/new_dialogue", locals: {:builder => builder, :model => model, :options => options}, &block

 

And the yield call in home/new_dialogue yielded to the correct block.

 

So what is the difference between render and render layout that made the block argument work with the latter?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users