All Projects â†’ dalpo â†’ Rails_admin_nestable

dalpo / Rails_admin_nestable

Licence: mit
RailsAdmin drag & drop custom action sorting list and tree (using the Ancestry gem) 💎

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Rails admin nestable

Execution time
How fast is your code? See it directly in Rails console.
Stars: ✭ 67 (-36.19%)
Mutual labels:  ruby-on-rails
Stimulus reflex expo
StimulusReflex demos
Stars: ✭ 85 (-19.05%)
Mutual labels:  ruby-on-rails
Pragma
An expressive, opinionated ecosystem for building beautiful RESTful APIs with Ruby.
Stars: ✭ 93 (-11.43%)
Mutual labels:  ruby-on-rails
Karafka
Framework for Apache Kafka based Ruby and Rails applications development.
Stars: ✭ 1,223 (+1064.76%)
Mutual labels:  ruby-on-rails
Rails Security Checklist
🔑 Community-driven Rails Security Checklist (see our GitHub Issues for the newest checks that aren't yet in the README)
Stars: ✭ 1,265 (+1104.76%)
Mutual labels:  ruby-on-rails
Instuigram
🎓 Learning Ruby on Rails through building the Instagram Application.
Stars: ✭ 88 (-16.19%)
Mutual labels:  ruby-on-rails
Binda
Headless CMS based on Ruby on Rails
Stars: ✭ 60 (-42.86%)
Mutual labels:  ruby-on-rails
Sidekiq Cron
Scheduler / Cron for Sidekiq jobs
Stars: ✭ 1,383 (+1217.14%)
Mutual labels:  ruby-on-rails
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+1103.81%)
Mutual labels:  ruby-on-rails
Graphql rails
GraphQL on Rails. Write GraphQL server side in rails way
Stars: ✭ 92 (-12.38%)
Mutual labels:  ruby-on-rails
Theodinproject
Main Website for The Odin Project
Stars: ✭ 1,227 (+1068.57%)
Mutual labels:  ruby-on-rails
Bhf
Rails-Engine-Gem that offers an admin interface for trusted user
Stars: ✭ 81 (-22.86%)
Mutual labels:  ruby-on-rails
Thesmallestrailsapp.com
Stars: ✭ 89 (-15.24%)
Mutual labels:  ruby-on-rails
Planner
🗓 the main codebar site
Stars: ✭ 73 (-30.48%)
Mutual labels:  ruby-on-rails
Sr mini
A single file Rails app that will have you running a StimulusReflex and CableReady demo in just 2 steps.
Stars: ✭ 98 (-6.67%)
Mutual labels:  ruby-on-rails
Ifme
Free, open source mental health communication web app to share experiences with loved ones
Stars: ✭ 1,147 (+992.38%)
Mutual labels:  ruby-on-rails
Rails React Boilerplate
Ruby on Rails, React, Webpack 4 boilerplate app.
Stars: ✭ 86 (-18.1%)
Mutual labels:  ruby-on-rails
Onebody
private member portal for churches, built with Ruby on Rails
Stars: ✭ 1,408 (+1240.95%)
Mutual labels:  ruby-on-rails
Lol dba
lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.
Stars: ✭ 1,363 (+1198.1%)
Mutual labels:  ruby-on-rails
Reactchat
A chat app built with React.js and ActionCable in Ruby on Rails 5.1
Stars: ✭ 90 (-14.29%)
Mutual labels:  ruby-on-rails

Rails Admin Nestable

RailsAdmin Drag and drop tree view for Ancestry and mongoid-ancestry gem

Sample demo available at: https://github.com/dalpo/rails_admin_nestable_demo

Gem Version Code Climate

Installation

To enable rails_admin_nestable, add the following to your Gemfile:

gem 'rails_admin_nestable', '~> 0.3.2'

Add in your config/initializers/rails_admin.rb initializer the configuration:

RailsAdmin.config do |config|
  config.actions do
    # root actions
    dashboard                     # mandatory
    # collection actions
    index                         # mandatory
    new
    export
    history_index
    bulk_delete
    # member actions
    show
    edit
    delete
    history_show
    show_in_app

    # Add the nestable action for configured models
    nestable
  end
end

Configuration

You could choose between two different configurations for your model:

1. Nestable tree:

To use this configuration, you need to organize your tree model with Ancestry or Mongoid Ancestry. Otherwise your model have to respond to the parent, arrange and children methods.

The nestable_tree methods supports the following options:

  • position_field: (symbol) default => nil
  • max_depth: (integer) default => nil
  • enable_callback: (boolean) default => false
  • scope: (symbol | proc) default => nil
  • live_update: (boolean | :only) default => true (:only is for live updating only)

In your config/initializers/rails_admin.rb initializer:

RailsAdmin.config do |config|
  config.actions do
    ...
  end

  config.model MyModel do
    nestable_tree({
      position_field: :position,
      max_depth: 3
    })
  end
end

2. Nestable list:

To use this configuration, you need a position field

The nestable_list methods supports the following options:

  • position_field: (symbol) default :position
  • enable_callback: (boolean) default => false
  • scope: (symbol | proc) default => nil
  • live_update: (boolean | :only) default => true (:only is for live updating only)

In your config/initializers/rails_admin.rb initializer:

RailsAdmin.config do |config|
  config.actions do
    ...
  end

  config.model MyModel do
    nestable_list true
  end
end

Authorization with CanCan

Sample ability:

class Ability
  include CanCan::Ability

  def initialize(user)
    user ||= User.new

    if user.admin?
      can :access, :rails_admin
      can :dashboard

      if user.role? :superadmin
        can :manage, :all
      end

      if user.role? :editor
        can :edit, :all
        can :nestable, :all
      end
    end
  end
end

Screenshot

Nestable view

Contributing

Submitting a Pull Request:

  1. Fork the repository.
  2. Create a topic branch.
  3. Implement your feature or bug fix.
  4. Add, commit, and push your changes.
  5. Submit a pull request.

Thanks

License

This project rocks and uses MIT-LICENSE.

Copyright 2015 Andrea Dal Ponte

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].