我有一個視圖目錄blogs
。在該目錄中,你可以找到所有的標準,傳統的HTML視圖模板:在視圖目錄中組織.html.erb和.js.erb文件
# html files within the app/views/blogs directory
_form.html.erb
edit.html.erb
index.html.erb
new.html.erb
show.html.erb
不過:我也有動態的改變網頁內容(大多隻是表格上的內容)一些Ajax的看法。目前他們都都混在.html.erb
文件,這感覺那種混亂和無組織:
# now showing the html AND js files within the app/views/blogs directory
_form.html.erb
add_foobar.js.erb
add_barbazz.js.erb
edit.html.erb
filter_by_team.js.erb
filter_by_city.js.erb
filter_by_state.js.erb
index.html.erb
new.html.erb
show.html.erb
我認爲這將是有意義的從js.erb
文件單獨的.html.erb
文件,但我不知道該怎麼辦這是因爲它們都屬於blogs
目錄。
如何在此目錄中組織.js.erb
和.html.erb
文件?