Rendering Partials From One Controller’s View to Another Controller’s View in Rails

后端 未结 3 1512
迷失自我
迷失自我 2021-01-31 12:11

I have a view for a controller called \"show\". Inside that view, i want to render the contents of another controller\'s view - and obviously, the logic for the form on that vi

3条回答
  •  孤街浪徒
    2021-01-31 12:33

    If you really want to render entirely another action (i.e. simulating a request to go through the entire Ruby on Rails stack), you can use Webrat (check Webrat screencast here).

    In traditional MVC web applications, you should rarely have a need to do this. But in my experience developing SOFEA-style and micro-architecture webapps, this is getting more and more common.

提交回复
热议问题