Code Monkey home page Code Monkey logo

rack-affiliates's People

Contributors

alexlevin avatar bry avatar lando2319 avatar nadavshatz avatar pelargir avatar steventen avatar timrwilliams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rack-affiliates's Issues

typo on readme.md

Great Gem,

I believe I found a small typo on your readme.md under example usage

str = if request.env['affiliate.tag] ...

  • Forgot the apostrophe after affiliate.tag, should read

str = if request.env['affiliate.tag'] ...

Doesn't like cookies with Path:

I want my affiliates to be able to link directly to a post in our app... for example htttp://example.com/posts/1?aff=123ABC

However, when I do this it sets the cookie path as /posts and does not find the cookie in the controller.

When I use this link http://example.com?aff=123ABC the cookie path gets set as / and everything works as expected. I'm able to retrieve the cookie in the controller...

I couldn't seem to find any options in this gem relating to cookie Path... I think what I'm looking to do is set the default path as / for each cookie.

Any ideas on how I can get this to work with any path?

Any advice would be much appreciated.

Redirect to /

How can I redirect to homepage from the original of /?ref=xxxx

Random internal server errors

I installed the middleware and am now getting random internal server errors when loading any page on my site. The log says:

!! Unexpected error while processing request: deadlock; recursive locking

I believe this is due to instantiation of Rack::Response in order to set the cookies. This is unnecessary since the cookies can be set with Rack::Utils.set_cookie_header! instead.

Setting the cookies this way resolves the problem for me. I'll submit a pull request with this change.

Rails 5 compatibility

The docs doesn't mention Rails 5 anywhere, I have been working with it on rails 5 and so far so good, you should add it to the README.

This gem works with localhost?

1º This is my config:

config.middleware.use Rack::Affiliates, {:param => 'aff_id', :ttl => 6.months, :domain => '.localhost'}

2º I send a email with a link and param aff_id something like:
<%= link_to "accept invite", new_user_registration_url(:aff_id => @user.id) %>

3º In root action in a controller:

  def index
    if request.env['affiliate.tag'] && affiliate = User.find_by_affiliate_tag(request.env['affiliate.tag'])
      logger.info "Halo, referral! You've been referred here by #{affiliate.name} from #{request.env['affiliate.from']} @ #{Time.at(env['affiliate.time'])}"
    else
      logger.info "We're glad you found us on your own!"
    end
   respond_to do |format|
     format.html
   end
 end

I'm getting the message on console:

We're glad you found us on your own!

What am I doing wrong?

Thanks!

rack-affiliate for rails5api-only

The design of the rack-affiliates based on sessions/cookies.

a project is needed to be converted to API mode with angular.

is it possible to make the project API support?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.