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
- Host: GitHub
- URL: https://github.com/bodacious/box_of_tricks
- Owner: Bodacious
- License: mit
- Created: 2011-11-04T23:33:31.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-11-06T13:39:02.000Z (over 14 years ago)
- Last Synced: 2025-07-02T06:08:28.029Z (12 months ago)
- Language: Ruby
- Homepage: http://katanacode.github.com/box_of_tricks
- Size: 215 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
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
*/
```