# :main: flexa_lib.rb # = FlexaLib # # Biblioteca para Equipe da Flexa de Desenvolvimento # # Incluir a gem no Gemfile do projeto # # gem 'flexa_lib' # # --- # # Usando os Geradores Disponiveis # # - Gerador de CRUD(templates de VIEW) # # rails g flexa_lib:crud NomeDoController # # - Gerador de LOOKUP(gera um controller e # uma view de Lookup em Namespace) # os parametros são o nome do model e a # lista de campos que devem aparecer no grid do lookup # # rails g flexa_lib:lookup NomeDoModel campo1 campo2 # # # Aplicação do Twitter-Bootstrap na Aplicação # # - No "application.css" deve ficar como no exemplo abaixo: # # /* # *= require_self # *= require flexa-theme # */ # # # - No "application.js" deve ficar como no exemplo abaixo: # # //= require jquery # //= require jquery_ujs # //= require flexa-themejs # # module FlexaLib end ######################################## ###### BIBLIOTECAS DE TERCEIROS ######## ######################################## #WILL_PAGINATE require 'will_paginate' require 'will_paginate_twitter_bootstrap' #TABLE_FOR require 'table_for_collection' #FORMTASTIC require 'flexa_formtastic_bootstrap' ######################################## ############## FLEXA LIB ############### ######################################## require 'flexa_lib/engine' if defined?(::Rails) # For tests require 'flexa_lib/version' #inputs flexa #require 'flexa_lib/inputs' #helpers flexa require 'flexa_lib/helpers' module ActionView class Base include FlexaLib::Helpers end end #Extensões e Conversoes de DATA require 'flexa_lib/date_extensions' #Extensoes para ActiveRecord require 'active_support' ActiveSupport.on_load :active_record do require 'flexa_lib/model_extensions' end #################################### #### Definir o flexa_formtastic_bootstrap #### como FormBuilder Padrão ################################### Formtastic::Helpers::FormHelper.builder = FlexaFormtasticBootstrap::FormBuilder ##### Definir quantidade de registros por Página em Paginação #### WillPaginate.per_page = 25 #validacoes de CPF e CNPJ require 'flexa_lib/brcpfcnpj' #### FIM DO ARQUIVO ##########