Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rails_admin_tree_browser

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails_admin_tree_browser

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Rails Admin tree browser field

A simple gem to work with rails_admin that allow you to choose element in a tree.

Usage

gem "rails_admin_tree_browser"

Then, add in your rails admin model initializer
config/initializers/rails_admin/modelName.rb

RailsAdmin.config do |config|
  config.model MyAwesomeModel do
    edit do
      field :db_path_field, :tree_browser do
        tree_root_url 'https://url_to_api_return_json.com'
      end
    end
  end
end

Config

  • tree_root_url - The root url from where we show the tree
  • tree_download_url - the download url from where we download the element, need to be download_link to true (Optional)
  • download_link - true/false Show icon with link to download (Optional)
  • button_label - Overwrite the label name (Optional)
  • node_type_name - overwrite de node type name, default: node (Optional)
  • element_type_name - overwrite de element type name, default: element (Optional)

example:

RailsAdmin.config do |config|
  config.model MyAwesomeModel do
    edit do
      field :path, :tree_browser do
        tree_root_url 'https://url_to_api_return_json.com'
        tree_download_url
        button_label 'Choose a file please'
        download_link true
        node_type_name 'dir'
        element_type_name 'file'
      end
    end
  end
end

JSON need for API return

example for https://url_to_api_return_json.com/node

[{
name: "element",
path: "node/element",
type: "element"
},
{
name: "sub_node",
path: "node/sub_node",
type: "node"
}]

FAQs

Package last updated on 19 Dec 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc