Code Monkey home page Code Monkey logo

helpdesk's Introduction

Helpdesk Code Climate Build Status Gem Version

Helpdesk is a Rails engine that provides simple helpdesk functionality directly into your site.

Demo

http://helpdesk-demo.herokuapp.com

Source of demo: https://github.com/wacaw/helpdesk-demo.

Installation

1. Install helpdesk gem

In your Gemfile, add the following dependencies: In Rails 3, add this to your Gemfile and run the +bundle+ command.

gem "helpdesk", '0.0.14'

In Rails 4.1, add this to your Gemfile and run the +bundle+ command.

gem "helpdesk", ">= 0.0.42"

2. Run installation/or migration if updated

rails g helpdesk:install

for update only

rake helpdesk:install:migrations

That creates a Helpdesk initializer and copy locale files to your application.

3. Add 3 methods to your applications application_controller.rb

  • helpdesk_user - to exposes your current_user
  • helpdesk_admin? - to check privileges
  • helpdesk_admins_collection - to list all admin

Example, for app with devise&rolify gems:

class ApplicationController < ActionController::Base
[...]
      helper_method :helpdesk_user,:helpdesk_admin?,:helpdesk_admin_collection
      def helpdesk_user
        current_user
      end

      def helpdesk_admin?
        current_user.has_role? :admin
      end

      def helpdesk_admin_collection
        (Helpdesk.user_class).with_role(:admin)
      end
end

4. Restart app

and visit http://0.0.0.0:3000/helpdesk

License

MIT

helpdesk's People

Contributors

designcitypl avatar johnbeynon avatar wacaw avatar

Watchers

 avatar  avatar

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.