Project

due_credit

0.0
No commit activity in last 3 years
No release in over 3 years
The system will give the user credit for the referral. You can set a threshold on a campaign so the user gets full credit
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 3.2.13
~> 3.2.13
 Project Readme

#== DueCredit

A rails engine to give credit to your users for referring people back to your site. For instance if you have someone sign up, you give them a unique link back to your site for them to share on Twitter, Facebook, Emails, etc.

##== Installation

Add this line to your application’s Gemfile:

gem 'due_credit'

And then execute:

$ bundle

Or install it yourself as:

$ gem install due_credit

##== Usage

Generate the migrations

$ bundle exec rails g due_credit

Run the migration. This should create the following tables: Campaigns, Referrers, Referrals

From your app

DueCredit::Campaign.create!(name: 'something', threshold: 5, endpoint: '/welcome')
DueCredit::Referrer.create!(campaign: DueCredit::Campaign.first, model: 'User', model_id: User.first.id)
DueCredit::Referral.create!(referrer: DueCredit::Referrer.first)

Alternatively you can put in a Rails initializer something like this

$due_credit_campaign = DueCredit::Campaign.where(name:'Product Announce', endpoint: '/').first_or_create

Routes added

get "due-credit/:token" => "due_credit/credit#click_through" , :as => :due_credit

##== TODO

A shit ton. basic link through working.

##== Reference

coding.smashingmagazine.com/2011/06/23/a-guide-to-starting-your-own-rails-engine-gem/

##== Contributing

  1. Fork it

  2. Create your feature branch (‘git checkout -b my-new-feature`)

  3. Commit your changes (‘git commit -am ’Add some feature’‘)

  4. Push to the branch (‘git push origin my-new-feature`)

  5. Create new Pull Request