Skip to content
Another Authlogic Vkontakte
Ruby JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.document
.gitignore
Gemfile
Gemfile.lock
LICENSE.txt
README.rdoc
Rakefile
VERSION
aavkontakte.gemspec
init.rb

README.rdoc

aavkontakte

This is beta version of aavkontakte - another authlogic vkontakte authorization. It provides vkontakte authorization to authlogic.

Install

gem install aavkontakte

  • Environment

In environment.rb:

config.gem 'aavkontakte', :version => '>=0.1.0'
  • User model

Add following line:

acts_as_authentic do |c|
  c.vkontakte_enabled = { :vk_app_id => "id", :vk_app_password => "password" }
end
  • Migrations

Create migration:

class AddVkontakteIdToUser < ActiveRecord::Migration
  def self.up
    add_column :users, :vk_id, :string
  end

  def self.down
   remove_column :users, :vk_id
  end
end
  • Layout

In the body section:

<%= init_vkontakte %>
  • Javascripts

After first start your application, it's copying vkontakte.js to your javascripts directory or if it doesn't exist.

  • Link

Put link somewhere, where you want:

<%= vkontakte_login_link "Login with vkontakte" %>
  • User session

In create action:

@user_session = UserSession.new(params[:status] ? cookies : params[:user_session])

Contributing to aavkontakte

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet

  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright © 2011 Dmitry Vorotilin. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.