Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
agpchil committed Oct 30, 2018
1 parent a474050 commit 37abfed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ Create config variables in your app's /config/initializers/ct_table_for.rb
CtTableFor.setup do |config|
config.table_for_wrapper_default_class = "table-responsive"
config.table_for_default_class = "table table-striped table-bordered table-condensed table-hover"
config.table_for_default_action_class = {show: "btn btn-primary btn-sm", edit: "btn btn-success btn-sm", destroy: "btn btn-danger btn-sm", other: "btn btn-default"}
config.table_for_default_action_base_class = "btn btn-sm"
config.table_for_action_class = {show: "btn-primary", edit: "btn-success", destroy: "btn-danger", other: "btn-default"}
config.table_for_breakpoint = "992px" # or could be done by sass
config.table_for_icon_font = "fa"
config.table_for_action_icons = {show: "eye", edit: "pencil", destroy: "trash"}
Expand Down
16 changes: 12 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,23 @@ <h4>Atribut amb parametre <code>:l</code></h4>
<hr>

<h4>CSS class i id</h4>
<p> Al hash d'opcions, es pot passar <code>id</code>, <code>class</code> o <code>tr_class</code> amb un string per afegir una clase, o id personalitzada.</p>
<p> <code>id</code> i <code>class</code> s'aplicarà a l'element <code>&#x3C;table&#x3E;</code> i <code>tr_class</code> als <code>&#x3C;tr&#x3E;</code>.</p>
<p> Per exemple, <code>&#x3C;%= table_for User, @users, options: {id: "my-id", class: "my-class", tr_class: "my-tr-class"} %&#x3E;</code></p>
<p> Al hash d'opcions, es pot passar: </p>
<p><ul>
<li><code>id</code> (String): s'aplicarà a l'element <code>&#x3C;table&#x3E;</code>.</li>
<li><code>class</code> (String): s'aplicarà a l'element <code>&#x3C;table&#x3E;</code>.</li>
<li><code>tr_class</code> (String): s'aplicarà a l'element <code>&#x3C;tr&#x3E;</code>.</li>
<li><code>btn_class</code> (Hash): s'aplicarà als elements <code>&#x3C;a&#x3E;</code> de les accions juntament amb el valor per defecte de <code>table_for_default_action_base_class</code>.</li>
</ul>
</p>
<p> Per exemple, <code>&#x3C;%= table_for User, @users, options: {id: "my-id", class: "my-class", tr_class: "my-tr-class", btn_class: { show: "btn-primary" } %&#x3E;</code></p>
<div class="row">
<div class="col-md-6">
<pre>
&#x3C;table id=&#x22;my-id&#x22; class=&#x22;my-class&#x22;&#x3E;
&#x3C;tbody&#x3E;
&#x3C;tr class=&#x22;my-tr-class&#x22;&#x3E;&#x3C;/tr&#x3E;
&#x3C;tr class=&#x22;my-tr-class&#x22;&#x3E;
&#x3C;td&#x3E;&#x3C;a class="btn btn-primary"...&#x3E;...&#x3C;/a&#x3E;&#x3C;/td&#x3E;
&#x3C;/tr&#x3E;
&#x3C;/tbody&#x3E;
&#x3C;/table&#x3E;
</pre>
Expand Down

0 comments on commit 37abfed

Please sign in to comment.