Socket
Book a DemoInstallSign in
Socket

org_chart

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org_chart

0.0.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

GetOrgChart.js for Rails Asset Pipeline

getorgchart.js is an awesome javascript library for creating organizational chart (documentation). This gem makes it easy to use it with Rails Asset Pipeline.

Installation

Add this line to your application's Gemfile:

gem "org_chart"

And then execute:

$ bundle

Usage

Add the following to your app/assets/javascripts/application.js:

//= require jquery
//= require getorgchart

If you want to use the default CSS, add the following to your app/assets/stylesheets/application.css:

*= require getorgchart

Add an Initializer to app/config/initializer/{nameofthefile}.rb and add a line require 'get_org_data'. In your controller create nodes i.e.

class HomeController < ApplicationController
  def index

    @node = GetOrgData.new
    @node.id = 1
    @node.parent_id = nil
    @node.name = "Irfan"
    @node.title = "CEO"

    @node2 = GetOrgData.new
    @node2.id = 2
    @node2.parent_id = 1
    @node2.name = "Imran"
    @node2.title = "DSE"

  end
end

Finally add nodes to view simply: <%= GetOrgData.to_start %> <%= @node.to_node %> <%= @node2.to_node %> <%= GetOrgData.to_end %>

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 20 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.