victorbueno / adminio

Rails Admin made easy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Steps to configure Adminio

##Gemfile

gem 'adminio', '0.0.1', git: 'https://github.com/victorbueno/adminio.git'

##Admin Controller

AdminController < Adminio::AdminController

private
def load_menu
  @menu_items = {categories: "admin_categories"}
  @logout = false;
end

##Other Controllers

OtherController < AdminController
private
def load_defaults
	@klass = Category                         #A própria classe
	@klass_name = Category.name.underscore    #String com nome da classe
	@index_fields = [:name]                   #Campos mostrados na index
	@show_fields = [:name]                    #Campos mostrados no show
	@form_fields = [:name]                    #Campos mostrados no formulário
	@actions = [:show, :edit, :delete]        #Ações liberadas
	@associations = [:option_group]           #Has many
	@assoc_extra = [:option_group_id]         #Campo específico do has_many
	@parent = Product                         #Belongs to
end

About

Rails Admin made easy

License:MIT License


Languages

Language:CSS 58.1%Language:Ruby 26.8%Language:HTML 14.2%Language:JavaScript 0.8%Language:CoffeeScript 0.1%