开发者

Rails 3.1. Organizing partials

Assume I have a small and simple开发者_如何学JAVA weblog written on Rails 3.1. So I have HomeController that is for displaying my blog's main page with navigation menu and news displaying in a main block. And I have NewsController that is for managing news. But I want to be able to manage news from my main page in central block if I'm an admin. For that purpose I need a remote form that will be displayed to the user with admin rights only and Edit/Delete remote links to manage existing news. Where I should place this form? It can be home/_news_item_form or news/_form. How do you think from the architectural point of view what place fits more for that purpose?


I think news/_form, because this form should applies in NewsController

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜