Rails 3: What CSS styles are expected by Rails?

I am creating a custom CSS stylesheet for a Rails 3 application.

Is there a list of CSS styles that Rails builds on? So far I have found:

  • #notice
  • #error_explanation
  • .field_with_errors

Thank you very much.

+4
source share
2 answers

Css for flash messages, which you can choose yourself, since they are usually defined in application.html.erb (by default there is no default definition for flash messages in rails).

For formatting, I would recommend using a gem, for example formtastic , which not only greatly simplifies the creation of forms, but also provides a standard css file. Thus, all the necessary tags are known (and you can rewrite them if necessary).

If, on the other hand, you look at ways to quickly launch your full layout, you can check web-app-theme or activo (which is even more complete).

+6
source

The new Rails 3 application will not require any specific CSS / id styles beyond the three you mentioned, so a default stylesheet is not created until you start scaffolding.

If you run the script/rails generate scaffold MyModel , it will create a stylesheet called scaffold.css , which the generated generated views will be based on.

+2
source

Source: https://habr.com/ru/post/1336346/


All Articles