阅读背景:

Rails:如何使用AJAX呈现页面并保持DRY

来源:互联网 

I have a calendar page that shows a person's routine for an entire month. At the top, I have button for the previous and next months. When those are clicked, I make an AJAX call to the change_date action which updates the dates and finds the new routines. When the change_date.js.erb is called, do I have to write the code to change the content for everyday's actions again? This seems to be violating DRY. Is there any way I can reuse the partials I used to populate the page on initial load to repopulate the page with the new values?I have a calendar page that shows a person's ro




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: