README.md in repres-bootstrap-1.3.2 vs README.md in repres-bootstrap-1.4
- old
+ new
@@ -8,31 +8,35 @@
Repres (资源表现)是一系列的资源表现引擎。Bootstrap 资源表现引擎包括基于Bootstrap的资源表现模版和片段。
## Recent Update
+
Check out the [Road Map](ROADMAP.md) to find out what's the next.
Check out the [Change Log](CHANGELOG.md) to find out what's new.
## Usage in Gemfile
+
```ruby
gem 'repres-bootstrap'
```
## Include the Helper in your Application Controller before Render the Style or Script with the helper methods
+
```ruby
include Repres::Bootstrap::ApplicationHelper
include Repres::Bootstrap::FormHelper
```
## Render the Pre-defined Partials
+
```erb
<html>
<head>
<%= render partial: 'repres/bootstrap/style', locals: { options: { bootstrap: true } } %>
@@ -62,13 +66,12 @@
</body>
</html>
```
-
-
### Render the Script
+
The Script partial includes the HTML script tags for Bootstrap and its extensions. Only the [Boot CDN](http://cdn.bootcss.com/) servers are supported.
The following code snippet does __not__ load any JavaScript library.
```erb
<%= render partial: 'repres/bootstrap/script' %>
@@ -83,26 +86,26 @@
<%= bootstrap_script bootstrap: true %>
```
The following code snippet loads the Bootstrap JavaScript library with the given version.
```erb
-<%= render partial: 'repres/bootstrap/script', locals: { options: { bootstrap: { version: '3.3.5' } } }
-%>
+<%= render partial: 'repres/bootstrap/script', locals: { options: { bootstrap: { version: '3.3.5' } } } %>
<!-- or the following line works identically -->
<%= bootstrap_script bootstrap: { version: '3.3.5' } %>
```
The following JavaScript libraries are switchable, and the version can be configurable:
- :bootstrap
+- :'bootstrap-material-design'
+- :'flat-ui'
- :'bootstrap-datepicker'
- :'bootstrap-datetimepicker'
- :'bootstrap-fileinput'
- :'bootstrap-table'
-
-
### Render the Style
+
The Style partial includes the HTML style tags for Bootstrap and its extensions. Only the [Boot CDN](http://cdn.bootcss.com/) servers are supported.
The following code snippet does __not__ load any CSS library.
```erb
<%= render partial: 'repres/bootstrap/style' %>
@@ -125,18 +128,19 @@
```
The following CSS libraries are switchable, and the version can be configurable:
- :bootstrap
- :'bootstrap-theme'
+- :'bootstrap-material-design'
+- :'flat-ui'
- :'bootstrap-datepicker'
- :'bootstrap-datetimepicker'
- :'bootstrap-fileinput'
- :'bootstrap-table'
-
-
### Render the Form Field
+
The Form Field partial includes the HTML form field tags for Rails Form Builder and Bootstrap.
```erb
<%= render partial: 'repres/bootstrap/form_field',
locals: {
options: {
@@ -163,13 +167,12 @@
%>
<!-- or the following line works identically -->
<%= bootstrap_form_field model: model, form: f, name: :photo, type: :file_field, input_accept: 'image/*' %>
```
-
-
### Render the Form Select Box
+
The Form Select Box partial includes the HTML select tags for Rails Form Builder and Bootstrap.
```ruby
<%= render partial: 'repres/bootstrap/form_select_box',
locals: {
options: {
@@ -183,12 +186,10 @@
%>
<!-- or the following line works identically -->
<%= bootstrap_form_select_box model: model, form: f, name: :country_id, choices: @countries.select('id, name').map { |country| [ country.name, country.id ] }, options: { prompt: '请选择国家' } %>
```
-
-
The 4 options are required: model, form, name, and type.
Here are more options:
- label_text: The customized label text.
- label_prefix: The label prefix.
- label_suffix: The label suffix.
@@ -215,9 +216,10 @@
## Generators
### Platform generator
+
The platform generator generates a platform with a version number. The platform name is administration in the following example.
```shell
rails generate repres:bootstrap:platform administration --version 4
```