简体   繁体   English

更新现有的rails应用程序以使用Twitter Bootstrap?

[英]Updating existing rails app to use Twitter Bootstrap?

I've an existing app built around a Themeforest template that is almost ready to launch, however, there are issues with the layout and some cross browser problems. 我有一个围绕一个几乎准备启动的Themeforest模板构建的现有应用程序,但是,布局和一些跨浏览器问题存在问题。 Through experience of using Twitter Bootstrap in other apps i've built from scratch i'd like to move this app over to using Bootstrap as well. 通过在我从头开始构建的其他应用程序中使用Twitter Bootstrap的经验,我想将此应用程序移动到使用Bootstrap。

Does anyone know if there's a safe & relatively painless way off migrating things across? 有没有人知道是否有一种安全且相对无痛的方式来迁移东西? I know from other apps where i've used scaffold, the sass files generated mess with bootstrap's styles so i'm pretty certain installing bootstrap with the existing app will cause all manner of nightmares. 我从其他应用程序中知道我使用了脚手架,sass文件产生了混乱的bootstrap的样式,所以我非常肯定使用现有应用程序安装bootstrap会导致各种恶梦。

In short, can anyone suggest the best approach for ditching my old template layouts/styles and then migrate to bootstrap without rendering the app useless? 简而言之,任何人都可以建议最好的方法来放弃我的旧模板布局/样式,然后迁移到bootstrap而不会使应用程序无用吗? It would be great if I could somehow run concurrent versions and then switch when i'm happy it's all working in the new 'look' 如果我可以以某种方式运行并发版本,然后切换,当我很高兴它全部工作在新的'外观'将是伟大的

Are you using git for version control? 你是否使用git进行版本控制? If so you could clone your local repository: 如果是这样,您可以克隆本地存储库:

$ git clone existing_repo bootstrapped_repo

Then hack about with the new repository to your hearts content. 然后用新的存储库来破解你的内容。 When I switched an app recently from Blueprint to Bootstrap it was fairly straightforward; 当我最近将一个应用程序从Blueprint切换到Bootstrap时,它非常简单; I used the twitter-bootstrap-rails gem, removed all traces of Blueprint and any scaffold-generated css and went through applying new classes etc. Mostly the pain is in having to restructure the app according to the new grid system. 我使用了twitter-bootstrap-rails gem,删除了Blueprint和任何脚手架生成的css的所有痕迹,并通过应用新类等。主要是痛苦在于必须根据新的网格系统重新构建应用程序。

Edit: Whatever approach you decide to take you will have the issue of maintaining new developments, patches etc. Whether this is all in the same instance of the app or not you have to decide whether to freeze other development or do this concurrently. 编辑:无论你决定采用什么方法,你都会遇到维护新开发,补丁等的问题。无论是否在应用程序的同一个实例中,你必须决定是否冻结其他开发或同时执行此操作。

Another option which would potentially suit a dev model that has ongoing development in it is to branch your repo and do the Bootstrap work within that branch and then merge it with your master branch when you are done. 另一个可能适合正在进行开发的开发模型的选项是分支您的repo并在该分支内执行Bootstrap工作,然后在完成后将其与主分支合并。 That way you should be able to run concurrent dev with your Bootstrapping project. 这样你就可以使用Bootstrapping项目运行并发dev。

There is a lot of stuff out there on successful git branching models: 成功的git分支模型有很多东西:

Hope that helps. 希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM