Giter Club home page Giter Club logo

rademade_admin's Introduction

rademade_admin

Gem Version Build Status Coverage Status Code Climate PullReview stats

Best rails admin panel!

How to use it

  1. Add gem 'rademade_admin' to Gemfile

  2. Update config/initializers/assets.rb with line:

config.assets.precompile += %w(rademade_admin.css rademade_admin.js)
  1. Mount rails engine at routing.rb mount RademadeAdmin::Engine => '/admin'

  2. Create User model and other needed models

class User < ActiveRecord::Base
  include RademadeAdmin::UserModule

  has_secure_password

  validates :password, length: { minimum: 8 }, allow_nil: true

  def self.get_by_email(email)
    where(email: email).first
  end

  alias valid_password? authenticate

  def to_s
    email
  end

end
  1. Add rademade_admin initializer initializers/rademade_admin.rb
RademadeAdmin.configure do |config|
  config.admin_class = User
end
  1. Create admin controller. Example app/controllers/rademade_admin/users_controller.rb
class RademadeAdmin::UsersController < RademadeAdmin::ModelController

  # You can leave controller absolutely empty!
  
  options do
    list do
      email
    end
    form do
      first_name
      email
      password :hint => 'Or leave it empty'
    end
  end

end
  1. Add admin_resources to routers.rb
namespace :rademade_admin, :path => 'admin' do
  admin_resources :users
end
  1. Install assets with bower rake rademade_admin:bower:install

  2. Start rails rails s

Good luck :)

Supported options

options do
  model 'ModelName'

  # Fixed table head if need
  fixed_thead true
  
  # Navigation menu settings
  parent_menu 'ModelName'

  # Setting for list data (index action)
  # list :attr, :attr_other
  list do
    
  end
  
  # Settings for form
  # form :attr, :attr_other
  form do
    attr :boolean #Other :text, :file, :editor
  end
  
  labels do
    attr 'Label for attribute'
  end
  
end

rademade_admin's People

Contributors

melanitski avatar praffesor avatar yurii-kurylenko avatar denysxftr avatar x-yuri avatar isaiev avatar andrey-abramow avatar robobee avatar vshaveyko avatar kogulko avatar maksymshutiak avatar fastindian84 avatar maxymbulgar avatar th3un1q3 avatar yivo avatar

Watchers

 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.