An open API service indexing awesome lists of open source software.

https://github.com/bodacious/box_of_tricks

This gem is no longer maintained
https://github.com/bodacious/box_of_tricks

Last synced: 11 months ago
JSON representation

This gem is no longer maintained

Awesome Lists containing this project

README

          

# [Box of Tricks](http://github.com/KatanaCode/box_of_tricks "Katana Code's Box of Tricks")

This gem contains a bunch of CSS classes and Rails helper methods that we rely upon regularly

## View Helpers

### BoxOfTricks#title

Sets the page title if passed an argument, otherwise returns the page title.

``` rhtml

# layouts/application.html.erb



<%= title %>


<%= yield %>



# users/show.hmtl.erb
<% title @user.username %>
```

### BoxOfTricks#field

``` rhtml
<%= field id: "my_field", class: "user_form" do %>
<%= text_field_tag :user, :username %>
<% end %>




```

### BoxOfTricks#actions

``` rhtml
<%= actions id: "my_actions", class: "user_form" do %>
<%= submit_tag("Save") %>
<% end %>




```

### BoxOfTricks#div

``` rhtml
<%= div id: "some_div", class: "vague_class" do %>
<%= link_to("Click here", "#") %>
<% end %>


```

## CSS

### HTML5 Reset Sheet

To include an HTML reset to your CSS, simply add the following to your application.css file:

``` css
/*
*= require html5reset
*/
```

There's also a file named [**box_of_tricks.css.scss**](https://github.com/KatanaCode/box_of_tricks/blob/master/app/assets/stylesheets/box_of_tricks.css.scss) which comes with a bunch of CSS
classes that I constantly rely on.

``` css
/*
*= require box_of_tricks
*/
```