开发者

Rails 3.1. Organizing partials

开发者 https://www.devze.com 2023-03-06 06:26 出处:网络
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 b

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

精彩评论

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