如何轻松保存 Rails 应用程序的 HTML 页面以提供给 Designer?
我正在开发 Rails 应用程序,设计师正在单独设计原始 HTML 页面。很难将他的环境设置为直接使用该应用程序,因此我希望能够以某种方式将我的应用程序生成的所有页面的 HTML“存储”到我可以传递当前版本的目录中交给设计师。
有谁知道宝石或耙子任务可以帮助我做这样的事情?
我也愿意接受与不懂 Rails 的设计师并行工作的其他建议。
谢谢
编辑
我想对我的问题的修正是,除了手动浏览之外,还有人知道生成页面链接列表以提供给wget的方法吗
编辑2
只是大声思考......要生成应用程序中的每个可能的页面,您需要调用每个控制器中的每个操作。所以我需要一个程序来查找我的所有应用程序/宝石/插件中存在哪些控制器,然后找到其中的所有公共方法..或者..也许我可以只使用可从列表中路由的操作然后
,你可能想过滤掉那些没有渲染html的动作
那么你可能想过滤掉破坏性的动作(除非这个程序在测试环境中运行,并且每次都重新构建系统)。
然后,由于许多操作取决于所提供的参数,因此您需要控制发送到每个操作的参数...
然后您还必须能够发送会话 cookie 来登录
其他内容...
I am working on a Rails app, and a designer is designing the raw HTML pages separately. Its tough to get his environment set up to use the application directly, so I would like to be able to somehow "store" the HTML of all of the pages that my application generates, to a directory somewhere to that I can pass the curent version off to the designer.
Does anyone know of a gem or rake task that would help me do something likee this?
I am also open to other suggestions for working in parallel with designers who don't know rails.
Thanks
Edit
I guess an amendment to my question, would be, does anyone also know of ways of generating the list of page links to feed to wget, other than going through them by hand
Edit 2
Just thinking out loud... to generate every possible page in an app, you'd need to call every action in every controller. So i'd need a program to find which controllers exist in all of my app/gems/plugins, and then find all of the public methods in them.. Or.. maybe I could just use the actions that are routable from the list of routes
Then, you might want to filter out the actions that didn't render html
Then you might want to filter out destructive actions (unless this program ran in a test environment, and rebuilt the system every time).
Then as many actions depend on the parameters that are supplied, you'd need to have control over which parameters are sent to each action...
Then you'd also have to be able to send session cookies to log in
what else..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此命令将从 http://somewhere.com 获取所有文件/页面并将它们下载到本地目录,以形成局部“镜子”。
注意:我不相信 Mac OS X 附带
wget
。如果您使用的是 Mac,我建议安装 Homebrew,然后运行 brew install wget
。了解更多:
man wget
This command will fetch all the files / pages from http://somewhere.com and download them to a local directory, to form a local "mirror."
Note: I don't believe Mac OS X ships with
wget
. If you are using a Mac, I'd suggest installing Homebrew and then runningbrew install wget
.Read more:
man wget