如何轻松保存 Rails 应用程序的 HTML 页面以提供给 Designer?

发布于 2024-11-28 03:19:34 字数 623 浏览 0 评论 0原文

我正在开发 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想你只要分分秒秒 2024-12-05 03:19:35
wget -m http://somewhere.com

此命令将从 http://somewhere.com 获取所有文件/页面并将它们下载到本地目录,以形成局部“镜子”。

<前><代码>-m
- 镜子
打开适合镜像的选项。这个选项转
关于递归和时间戳,设置无限递归深度和
保留 FTP 目录列表。目前相当于-r -N -l
inf --不删除列表。

注意:我不相信 Mac OS X 附带 wget。如果您使用的是 Mac,我建议安装 Homebrew,然后运行 ​​brew install wget

了解更多:man wget

wget -m http://somewhere.com

This command will fetch all the files / pages from http://somewhere.com and download them to a local directory, to form a local "mirror."

   -m
   --mirror
       Turn on options suitable for mirroring.  This option turns
       on recursion and time-stamping, sets infinite recursion depth and
       keeps FTP directory listings.  It is currently equivalent to -r -N -l
       inf --no-remove-listing.

Note: I don't believe Mac OS X ships with wget. If you are using a Mac, I'd suggest installing Homebrew and then running brew install wget.

Read more: man wget

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文