Affiliate Handling plugin, based on Rails Engines, for a ruby on rails based app.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db/migrate
spec
tasks
test
.gitignore
README.textile
init.rb

README.textile

Only use for testing purposes – you’ve been warned.

Definitely not production worthy at all, but enough to give you the flavour.

Issues will be tracked via this github project’s issue tracker, so feel free to contribute issues during the testing phase.

Rails Plugin Dependencies

Having used the built in rails engines feature of 2.3.2, you’ll need the following two plugins available.

These are really standard plugins and you may have them installed already.

Installation

Set up the two plugins above first

Then it’s just the usual command:

script/plugin install git://github.com/nerbie69/active_affiliate.git

Run the following rake task to get your database migrations ready:

rake active_affiliate:sync

then run

rake db:migrate

That should be it.

Useage

More to come but check out the routes, and setup your affiliate_settings for sure.

One last thing will be adding this code to application_controller.rb

#check for an affiliate link on every login. if found set the session variable.
before_filter :affiliate_link_check

##check for affiliate links
def affiliate_link_check
session[:affiliate_id] = params[:affiliate_id] if params[:affiliate_id]
end

this will change i’m sure from session to cookie. There will also be more info about hooking this into your shopping cart, or whatever, so that people can get credit.

Hell it’s a start :-)