Settlebox
Rails view helpers for easy integration with the SettleBox API.
Installation
Add this line to your Gemfile:
gem 'settlebox'
The run:
$ bundle install
Configuration
When you signup for SettleBox you will recieve an API_KEY and an API_SECRET. Put these in an initializer for your application.
#config/initializers/settlebox.rb
require 'settlebox'
Settlebox.config do |config|
config.api_key = "API_KEY"
config.api_secret = "API_SECRET"
config.lang = :en # This optional currently :en and :sv are supported, :en is default
end
After this you are ready to go.
Usage
The gem comes with a couple of helpers that helps you include the SettleBox widget. For a more fancy description of the API with interactive guides see SettleBox homepage.
Javascript
Include the javascript tag on any page that you want to make use of the SettleBox profile.
= settlebox_include_tag
View helpers
Signup
Include this on the users settings profile page.
= settlebox_card_tag('[email protected]')
Reputation
Include this where you have more space and want to show the complete SettleBox profile of the user.
= settlebox_reputation_tag('[email protected]')
Listing (Cube)
This is the SettleBox cube which has an hoovering effect. Use this where you have alot of items in a list.
# href tells SettleBox where to go if the cube is clicked
= settlebox_listing_tag('[email protected]', href="https://settlebox.com)
Debugging
To easily try out the SettleBox gem and API. There exists a demo user. The demo user has the following email address
# Replace the * depending on how much information you want the profile to show
demo_*@settlebox.com
# Examples
# Will show a profile of a user that has connected everything there is to connect.
demo_full@settlebox.com
# Will show a user that only has connected facebook
demo_fb@settlebox.com
# Will show a user with an avatar, ebay and twitter
demo_av_eb_tw@settlebox.com
Supported options for the demo user are.
- av = Avatar
- fb = Facebook
- tw = Twitter
- li = LinkedIn
- eb = Ebay
- tr = Tradera
- pe = Percent of good ratings
- to = Total number of ratings
- aa = Total number of listings the user have
More on SettleBox
For more information about SettleBox please refer to our homepage SettleBox homepage.