[英]Can i render two different controller actions in a single page in rails
So basically what I am about to do is have a fixed search bar with is results.所以基本上我要做的是有一个固定的搜索栏和结果。 And also view page of the selected result with links to all its CRUD actions, and also link to move to other associated controllers.并且还查看所选结果的页面,其中包含指向其所有 CRUD 操作的链接,以及移动到其他关联控制器的链接。
Now when I click on edit action or if I choose to move to another associated controller view the search bar and its results should be unchanged.现在,当我单击编辑操作或选择移动到另一个关联的控制器时,搜索栏及其结果应该保持不变。 I have a basic understanding of jquery and ajax, would I need to try angular.js for this.我对 jquery 和 ajax 有基本的了解,我是否需要为此尝试 angular.js。
So to summarize I need a fixed search bar with search results unaffected on moving from one controller to other.所以总而言之,我需要一个固定的搜索栏,搜索结果从一个控制器移动到另一个控制器不受影响。
Please help me figure this out.请帮我解决这个问题。 If you have trouble understanding the question leave a comment.如果您在理解问题时遇到困难,请发表评论。
If you want to render two (or more) variables in a controller you may do something wrong.如果您想在控制器中呈现两个(或更多)变量,您可能会做错事。
I see several options here.我在这里看到了几个选项。
(Also read this . It has a slight example of Facade with Rails) (另请阅读 这篇文章。它有一个 Facade with Rails 的小例子)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.