简体   繁体   English

CSS 和样式,Ruby on Rails

[英]CSS and styling , Ruby on Rails

I have implemented a Rails project which has a lot of forms, but they do not look good.我已经实现了一个有很多表单的 Rails 项目,但它们看起来不太好。 The new , edit , and destroy buttons are very close to each other. neweditdestroy按钮彼此非常接近。 Listing the items in each form is also ugly as the columns are very close;列出每个表单中的项目也很难看,因为列非常接近; they definitely need CSS and styling.他们肯定需要 CSS 和样式。 Is there any sample or template that I can use?有我可以使用的示例或模板吗?

For general styling you can use Bootstrap , there is even a gem to make it easier to integrate.对于一般样式,您可以使用Bootstrap ,甚至还有一个gem可以使其更容易集成。

For better layouts and automating the form building process such as new, edit actions, you can use Formtastic .为了更好的布局和自动化表单构建过程,例如新建、编辑操作,您可以使用Formtastic

Another one that's as popular is simple_form .另一个同样流行的是simple_form

You can find even more form builders at the ruby toolbox site .您可以在ruby 工具箱站点上找到更多表单构建器。

As you have mentioned little about your application, its hard to tell what styling you should chose.正如您几乎没有提到您的应用程序,很难说您应该选择什么样式。 However as @olive_tree mentioned, bootstrap is simpler and a convenient option.然而,正如@olive_tree 提到的,bootstrap 更简单,也是一个方便的选择。 You may want to check this rails cast你可能想检查这个 rails cast

http://railscasts.com/episodes/328-twitter-bootstrap-basics?view=asciicast http://railscasts.com/episodes/328-twitter-bootstrap-basics?view=asciicast

Bootstrap is definitely a good place to start. Bootstrap 绝对是一个很好的起点。 Personally I prefer ZURB Foundation, though, but that is mostly a matter of preference.不过,我个人更喜欢 ZURB Foundation,但这主要是偏好问题。 Here is a link on how to integrate Foundation the easiest way:这是有关如何以最简单的方式集成 Foundation 的链接:

http://foundation.zurb.com/docs/applications.html http://foundation.zurb.com/docs/applications.html

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

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