templus_models 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +34 -0
- data/app/assets/javascripts/raro_crud.js +95 -0
- data/app/controllers/crud_controller.rb +148 -0
- data/app/helpers/crud_helper.rb +169 -0
- data/app/helpers/search_helper.rb +241 -0
- data/app/raro_crud/raro_crud.rb +274 -0
- data/app/views/crud/_crud_template.html.erb +35 -0
- data/app/views/crud/_edit.html.erb +1 -0
- data/app/views/crud/_form.html.erb +68 -0
- data/app/views/crud/_links.html.erb +0 -0
- data/app/views/crud/_new.html.erb +1 -0
- data/app/views/crud/_record.html.erb +51 -0
- data/app/views/crud/_records.html.erb +24 -0
- data/app/views/crud/_scopes.html.erb +18 -0
- data/app/views/crud/_search.html.erb +20 -0
- data/app/views/crud/_show.html.erb +60 -0
- data/app/views/crud/create.js.erb +13 -0
- data/app/views/crud/edit.html.erb +8 -0
- data/app/views/crud/index.html.erb +7 -0
- data/app/views/crud/new.html.erb +10 -0
- data/app/views/crud/show.html.erb +8 -0
- data/app/views/layouts/_menu_crud.html.erb +8 -0
- data/app/views/layouts/_template_raro_crud.html.erb +73 -0
- data/app/views/tabelas/_precos.html.erb +0 -0
- data/config/initializers/raro_search.rb +17 -0
- data/config/initializers/simple_form.rb +173 -0
- data/config/routes.rb +13 -0
- data/lib/generators/crud/USAGE +8 -0
- data/lib/generators/crud/crud_generator.rb +10 -0
- data/lib/generators/crud/templates/crud.rb +52 -0
- data/lib/generators/crud/templates/crud2.rb +58 -0
- data/lib/tasks/templus_models_tasks.rake +4 -0
- data/lib/templus_models.rb +9 -0
- data/lib/templus_models/engine.rb +4 -0
- data/lib/templus_models/version.rb +3 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +14 -0
- data/test/dummy/app/assets/javascripts/crud/alert1.js +1 -0
- data/test/dummy/app/assets/javascripts/crud/alert2.js +1 -0
- data/test/dummy/app/assets/javascripts/jquery/jquery-2.1.1.js +4 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/ability.rb +35 -0
- data/test/dummy/app/models/teste.rb +9 -0
- data/test/dummy/app/models/teste1.rb +5 -0
- data/test/dummy/app/raro_crud/#{file_name}_crud.rb +0 -0
- data/test/dummy/app/raro_crud/pessoa_crud.rb +50 -0
- data/test/dummy/app/raro_crud/teste1_crud.rb +14 -0
- data/test/dummy/app/raro_crud/teste_crud.rb +58 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +39 -0
- data/test/dummy/config/environments/production.rb +78 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +8 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20150415214253_create_testes.rb +9 -0
- data/test/dummy/db/migrate/20150416220930_create_teste1s.rb +10 -0
- data/test/dummy/db/schema.rb +31 -0
- data/test/dummy/log/development.log +11980 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/fixtures/teste1s.yml +7 -0
- data/test/dummy/test/fixtures/testes.yml +7 -0
- data/test/dummy/test/models/teste1_test.rb +7 -0
- data/test/dummy/test/models/teste_test.rb +7 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-0RkuYMXJCukyo6fA0YmSXUwMd47QpzpUhQatZpEqkY.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-AtorCA2iqgAMYxvH7W0eRa0fsPWw_adQ1E2a4T-ncs.cache +3 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-MzeH9Nm-DG1fsBzYAO6iyo-dqHmHQD5JQiC725Whko.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-fEzfBEg4v147_Xfhlzq6AcSNGSYcxiMFDcZiY__4qg.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-raUXfOtrQirgvak5TOJHfEFDLcORHoJWFVSkL2kFLQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-rj6TLs6ScHy9rBVR1FtAG7sMhFwBhL-h_ql0-fjoO8.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/00RruQPZ9NMEjxmmNLv-brb7Dz3JIcMmqznNLCV_eBg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/0zYv6B2AICV6CQqG9xsbhg0q0zgBEqHmqYT_oM2t63c.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2R9HI_ug87lStS_VoW5EAjaLi9vK_6V7QD6kCsr8i0M.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2WJz14KMpvhFJIFov0mbMmTKFGtCLEC36x7lVjzq87U.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2WRAXn1FZWe_1EQTP6dnelRkMOSABdpw4I1BgWO87UE.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2_CA3YFYuY8rjSK2fn5wiT8aepkp6YGqTYOjRurC220.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3PB0fIDBf8wgB_W12ygFqvjqAlXcuHtoolp3A2Qcdsw.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3plMbIHZMFJHbJTBWe2g7SenboxXqlxzU8aI900m22E.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3s3k0T7lXZyr84Rkm9J_VXqLwYW_I4_hXj7FOH-zfLM.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4B-h9SsGXeh2w8VQGniJjUysS2w7rO8I5c5JSUzp08o.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4COj5bJqFYUkKXUEQ47_DmXTi6Ac8IsStYYK5lo9LWc.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4Jm4uat5-HtEtboNSBYcPmZcwKBKYzcBa_DasUL3qNY.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4rTGqQYT_JbF0LetrygDgyPCH9is1SatjEQe-8k78so.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/50IW238EtzEH5989d0XdN803CNIGp1InvXlIAU1HM40.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/5s_bVndzZYo6nm7AZyOJxU4x3kvhcKsyqIKfcC_2Iu0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6HYdSeJp0z3vfKTcO-NmYDcSJGsWpIRKiUQTx4wz4hE.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6QgJZL40nTelMwpeat779Ykv-8Dth_sdqaRfkrNDhiI.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6RfXmG9hCd6ds3txAlhE3SWj0j606PtQi64RPEM-TcA.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6em5auU0KgFUqVS55AUI5FFNo1Yall5joJNTPh6cREM.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6kJYp3x1cBZDpDSd_3XEOz6ifWEwKOE3Gb5z5Zoxt84.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/74SkyQLF_kk_zAkQfJT0erg9zkZ6Fofeu05Fexi2a5w.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/751lrK8ccX2v0VkMqF0nY6eMMFzmjQ0l3vatKsjPoG0.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7Gyv818zzArjMYxSFo6BCf-PRW6AYStsOd4xLRmF8hU.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7qXrvz_aUAoXT6FIX0DxsF9CTccT5fksyglG-DHDMfI.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/85H49xavK_2TtUGG0BAapvIqdyry4-7eH0f99YabgSc.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/8a2Q3fVjuE3Z7z0R5agncr869C89Cummxep05-u4UWw.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9AVKXW1Jc3ILufGozaIo5yvFLEaPS_zAwfHbO__usIs.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9WjO6_wu3g8yBTUfXWpOlu6yDNz-nACKkeuVxV7TSuo.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9oqzZU1KzLnwoLPfmeAx8oMfMdXsnZpq-jZB5-rNYqQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ALbGYuKATYSyElK_JYkccwgBRS3Lx61h74toN1jliI0.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/A_Q5nO455RK-6h7qFBGx6NtGhbVJORpYvJ4RZs8RaeM.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/AdReWx5s_03lXymktcB3CMl6CTKFus2HTcOJvGhdCUw.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/B0rzMLMi8Ci8Q47RmCw4vHizwKPwIAeNjvGEb2qJbzg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/B6oh0lsvUcgddWUpcJhGWeson5WKq9oXNm--8MbrOWs.cache +6 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BBUbO6W8N9-HtTfZjgASnsqBUePYt3-1RHFFp8u0u5U.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BGf7Y0SyTPz9Ydt8hwJRXQ4EroI1gI107ukxlevk5Z8.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BvU-skW8wL4KmDFzH8XT1gUWXo07dmQ0FoB8M_8bofA.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CUl-GCrcAiBnZAR6OPR1vtmvZvPqWWAdLZMfIPZJYb0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CceiAev4oDf3En1JQCOEbxL3h03YbKFxFDc0hV8KUgw.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CfAlr2nebJ3Kl-Lcydx5d7Yv6iRRelwdfXmVCp27BEY.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CyLoGmEoSwmAeobjNGvGhebq_-s3ejljxrVV6czKqSU.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/DF6ikykd1zv_eO5SEGyMxuxwd7mBtZNnk1kojMCscA0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/DMuQdFrhOQ6urUFtNTl6rJJqcaNloLms8jg1Tf5pUhY.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/EdhOx5YJzUYE7Ys67yOzg04iV1LoIkN2C3J-V6Kd7kA.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Eoz00hNTX8KygNr0aVpIEbh34MSEDX5m7ZqR8Lad9OE.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/EvmXBcpSJlMPk0SMVRVNxX3HOkhFyF-hmBynvhH407Q.cache +3 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ExITjXq3B3I4D2iPC9-7bWBMQMG067_pNyr51yzERWg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/FuxdU4c7Xc6cHVNpEbfk4KCJYp6NKj1jD1LvHQr87G0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/G1BmAqwKmBzIzvmqHrnas7bseYPySeYy_kKQUCudyRI.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GtlaUxUQN9roRptWCK4bcibWSGXX8YZOUL7rv6A3bMs.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/HM5akuFqjvooR5YQPelVy9Gp2DEIXBhbCtXtEJe_Gw4.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/HVGc6yBzGqr8JZ9wVVx9DwuAoB62xqX5o7-7GF8_D2k.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Hp2z2qsfAtIig0amAkDdPBx8YTqC3eI6i13chZgIP84.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/I3WA6ZiWG-zuR5mSSRisBfw157kRwx6rq6lCw0GvJuc.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/JS4ML3ziOZ-0gHe13rM5fwAREuPNrJ-gZFjO3srZStk.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/JXCGqqJsYbeS4osNafEUotYV8g2yH-okmlCShN2_skY.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/K7qFaWBvn05qTKLldfHX3OEFRM776XCtH2oKNpbwkVE.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/KEZbyOpyYalySpkvic4ZC-V30PpSmlS7hlnkzTIVzcI.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/LPXp9MfnAoNxpQnHzcYEg5vRityYS8YU3catMirmhE4.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Lz31lhNAZRtljaFrKzzDxo9anoBL4UXf0b6qSu3ixOg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/MAV4GtRsTNuMa7mh-FRGi2wL9z9semz4ipA-taBAp4w.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/N25GQGIWXDow0UJUDlGjYFTg8_UB925vu960hWdxlSg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/N2Kc4daD17uXszWGiTWCpGWU7uIclgJ1QRaAdY5Zg1M.cache +3 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NFE5HSRPELMk2JjUOBW48fPksAlUV8kIVYmdAeSryl0.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NkWwgnvgSUOGryPKuNnkQb37Udk1rbSi61oM7hFbS-0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NzbuktItre-lQg5qhPHMdUL0ZwJLhELLqjL7Ak6yoE8.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/O3U8kR_sGWfEYOfQtUzA9R7yWGaQeHdWnTMBtHOCqK0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/OPYstxXigozf6p1NcN6nFnBUONF9Crz_2Xe3N4N4-tk.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/P2fhx18EfM52CRdcUcVblqJ3-2-kPkAqnOJfuBgNUxw.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/PHuB8XHtS6zagW6bl1nAke04twK5oE_0P7MdUnhrp7A.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/PhQ3QEw8R2R0F2G7n62dm5Nj10IhS_GSAIG82MvXc7c.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Po2LrqIRsW1B-1hA6ydI-Rt_mpx2pXBac66EN2hhshA.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Pv_TicOezYHAqPrhipb0dtidBfvIzfu-rjKFTW3yl1I.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QJefgE9eLObDoOA71vu5TV8kqFobztSkhB_mw7H4_-Q.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QcXaJ4--BWzhpQD7doOhC-SygbDl5oyf-HOuVprksh4.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QogVK7Zl4bvRfOdAM7ZsEkUgbV84BW22FN5WPi1Jhm0.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/R5HsD0POG0xexSuYEwLy2ad0x3hBHFusyes1eRU0N6Y.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RAlAgkJK39zk8mrzAiedu6RIgni7Ca95CDYewbIyqyU.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RlHMp3gZ1aRTediB9KIBC-JNz3IXwShkqClSTt4gH7Q.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RrimogpCYT4gLOhSxEP23MTWQKLes2NFZauoPVBKoh0.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Run9n7a73bx1qzBABFw705w_RTLh2hDFRZ1pxxX5A9k.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RwKuSDjm7JYYkbvfOLdCGgzeIqDJw8UkcJXHv-PCaw8.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/S1P584VolTNZh4Ih05tAW__rYq64a1bPJy4Ku_MekC8.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/S8qr6hNqBkDfzk_M783TIbmCgtyDIA6x9uW5TONaP-w.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SJ3EEmIti8GPIgc0WexzzMn6kEEZ0t9kpzifJsADKVk.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SNJD-4NH0aXPJecBz7iofpNPHR217ufNeftApCooPjg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SUgEmzuKRgYzQPBAVtWz-hBg99Riz9wLvi6aHWnDEwQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SfnKk1dQvf8qIKaCdUsVa2cjOtgM_Xj6NQcYfy80Ck0.cache +3 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Sxj5zwmBihDy8UhTHtImyrN1_KKkcla1d7JDVKuYip4.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/T-2u3VedKGzdLVQKVEWEPTlTfZp5VNvqcVJES9esUiQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/TCXLy1tuwOhuK--MGtxXQFDTVo0EzGWm7SmJL2DebN8.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/UCn-O-RZ6clYhkVyWgHMWglyAPFouB_VaQVDJrL9Z88.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/UD5VPXqQzQVdXxBKbHriF6JCw8Qb9i7UE69lCXVN2OI.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/UKKkjAe9vIzKz6qCsd0eyqIvSip6qtm9-YQbKZ-ze1Q.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/V39AXCaEZmT-kOlIoZiCD0AyP1s7Xu7p94qQYQAt2s8.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/VJtHFSLCtAMr7n-S0iAcXJuEeWLSGWr6HHdKJ_BbQpc.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/VkKNjTO7kyAVClPp7bsHvVeLtvERoW59_A7Uo6lktlY.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WIXMTWvd2zBvQTEEpe9iJeFWW3lknQM0WLaB9LxMfg4.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WNYt-1VbjD4C9NEaYRJP1zlEmVzYt0ZIDESu5IcpMTU.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WX9tkL5_hG-PV_IQFjT26XsvSWhf85ZXv0nK2tBarGM.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/XB4hg9UPbd45TylzMYymCymRnR7JxkQMpfCkeOT-3j0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/XQ4aIm-_RQNLlv_p-dZByJg8jsTS6LZs6lFARh-xWt0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/XikcGw0VNsR9odl0TNFSH11KSaRXARhXT-Ikb44Kr6o.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Xu95SO3OK8xHiuD7VNZIsN5kLyB7ZLoOaSppRnpa2L8.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/YJFZ_DgaJy6oEgEbRNYq_xbT5hg7Eu1h3WM5JPo7rdY.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/YxDHUFE7wdRHeXKHLDmwSwz4fl9RkdIDtzeS8cnAyIE.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Z6u7GBxS_lJQoT58OLOlQ45pyYfRR9Cv3hTyfbLYbjw.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/_E5NnnUabpFFzkAQQ0RUiN4_5tRCHxdzu1_My4tw6IE.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/_tyOMUndB2DVeq9nwU8pRQ39CkAU8lLzlFSrMNf_S3s.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/a1AuugcwlWVX_ZnsaPnA4nvs_I74k_1BrwyftiVO7a4.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ar7XJXwMY_jRPYT6bfHpiMHlM8I4blvXzDgIZ50aMoE.cache +3 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/b-4ZOkjwvbGyC48dHtxES-yjISuUiqX-MPIZBgVu4iA.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bLSqdfBxS0hG8iE9YGbz6XcdnT76l3bqqbH1j-8VYMs.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bM42Ou_AvvRvhSpuZqF7sPrYdGg-8tuEwQ14R4YpJDQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bO3GaNycaPsLp3vX0Bgw7LYjlecep0FefE2Wsg2LH6o.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bmIthijT-qXHXtpDdnJPqADbj3aN2WcF-niJo-CW6kc.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bslCOFLEjB4LrqrjRzN4iOo3XJzXCUgaZRWI21lyOcI.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/cei-NTbQTYBnfaLXMg7W6WJtPBQXucHzybQzztHfPek.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/d6lfgb9qmUmGi5Ky9sB1L0FXLN_zXO8y-0eDtIMPmI0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dVz07HiNkWxAeWuyadttjZ8gjJERJ4-RVt2kfFnPza4.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dlTvwgYuIwoWEZGMoujEUgkC4BpMgcX27kQjRdUgHuc.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/e1WZZp0R9rj2aqI4sqtaPoR6rPwIcIhLCDZW6RJSKjY.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/enSxWB88Tfl_5rIdKRRR658oDujh_E7di20GL-1ZIS0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/f0dWb4ayOVY6BW4NdPUh_ZBZDm31umoKULCxP7JsSeQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/f8kJ7icPeFCN4AhIHCJUkizUReVZI4BJH4IUfaixE2w.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fG3BvTkCrakUd3CVBYY8kHi1A8Yv2lcvbLtUmAVlCoY.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fP_fEndiX1YdfVxwuEQsbk2nFv5nvBIY2eVVrLbAVfk.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fk6VEJiGQHxr9GVfpsjW5O8eixvxYj6LMFxzQrh6Xkk.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/frnU1s3KmCm5DwyiZk1bFaApN7XgeMPSviilEaAqTig.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fvlVm0klEuWZekWgCSvDLOGw9peTpqOIwmACHsSwtL4.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gKpBPMi-T0qbsZWmO2mEuO1rR1tnI67HkR7fV5-MiKU.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ggkncbfz1SC-5i7rp2QXjHn-SPQYv-c2oaJTP4kl3-Q.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gyxR-VFHc3_dn9O9lS5SqQK_DXawjrt4H8PMI2hV-So.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/i8KeXclJwkLX6gr6Vr6L_wdN1c429kOOUakNGccYIWs.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/iJxOOx5Xnu8h5BXQzcUgfZlrfKPN9k-Q8dy3EwIg2Dk.cache +6 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/iUBSNc-5E5E4cN6X25OxX6APuzCtcxlfYazpNqhcQFU.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/i_me0DwVwcfHchaKe9FFKjwORU_G61cz1heJSHNC4i4.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/isPH7sBbG8wW0XpIU8w2JiRFzKmqpb0B3PtfjY-Fju4.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/j10VJq1uwquWfiehjlw7kyrv_W-Gui-hrZFhaPVbzI0.cache +3 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jHE2MSq7IKoXNMSSFB-DwZ8aKQvd-R4CPVH7K0q27_k.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jRxj7keJ-TAUqhgV0FvFYkM-p6pXRilTBNt7Xh1VX_E.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jtifSOVyGP_LNOAtPAUbEWNhcPQpnWTVp7lvyMvOnLc.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/jyvcPE97vy_b-82NOzpqEX5jeTagB1kN4W1Wp45i4uk.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/lAsroOrUZ4A2g90xX5jCzdRCYREw6VKOj0xBIJYMiGY.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/lDe8sNEstNhniLIjHzYf_vHQjlEQV4qH-REZVOMOjFc.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/laBJzx_b6JUB8MPLlFlxbgN_xkef7mGv0WN4tQIO2cg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/m4ZJqBa8y36aVwf3N0mF0-3RtnYRQCfqbGQJe-Lc_5g.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/mYMDaxAPAJM8ErG8TXvZQxol46eqK3AV3CQ8G8V-b4M.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/mxschIrqaPr6xevnPQT5ef8ZeaIgUSQ0RADbaMREQEA.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nJboFt8klA4zcXScAuBNJoSmGktbcif8nSSeWpLUEMk.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nOYKNZpj5-0kIhxeV40X6DsgyL8S66Ahhg66h2JBKG8.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nPoU98hJn_xwYkQDLg-VGhLzDs24XLcwgcX65MBQE5c.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ntqZkzoIE68aMjuc0yp-tmVqAc_-5xq69ePuaKaQOso.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nuc0ksGFSHVwsH9Sqi7WP_LJbqW_IjT6_XkDrdX3MjE.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/o0W3V7MDQHortA5GOSC6ii4M6sUqp5lzzGlW7DrNHsQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/o4N2GkOe3km73jRtXr6g1RhVtqBHmQXipLQSccjjics.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ogvxFdj-oDmf63tOXEM5hp4plavRvExl8Qnqap8sW7k.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/p2enRakkRzJyMpSAJawDAE0o_OBSrSIa7KdUv-lcMow.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pHanFOUjaiuOlFtAv0dzy0MwMv_BuFtRR8JTcYXg2XQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pQziWwowuowx0FOYx2HAk84JbNUZcALmDixIYvQuJZg.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pS0_jaasn7nnwtSdY5bIvEr-P6DaJU7HsyH9sFKE0GI.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pxF_aFjVSm677g7jSkzExURX9cgPazYDabFXsta4Txo.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/q4l5PLa8Zl9VK3e1PNYVXbSB1LW6ayfSq7YYMUSbgcU.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qKd0hTNCpbPOAgI3T6Om735FkvgjPnpGRPrMP2z0k2c.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qTqEguBBn4OieaN6XlRehOzjelVJSOsfcjfNKSBi_h0.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qc1z_lojge7OJ0N9FLjaFenXsN82iIEnKN5S-t_sBlU.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/r93DDvPtjPyZa8taxSosNNvvOyHtMsF_ngrSs31aHOY.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rQM71yPXAdtASPadnfu1m7F_gQOb-uh_Adxs5P55R7U.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rbjKrg9BdrF2KtWN35sVH9aZOwvhLrEdX1xsyaYpxEM.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rcIDrjXwMeotIKYDncG2DGA50sE4HAYSUVSEYT2_VIE.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rtP4xELGID8pEJo_BvmsxpiYVBxvMCLlvdlJUvUgqEg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rykyMLrVFRiIIFUPH9OmnTjB-rUqcfXIXnpn5BW9Qm8.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/s4TQBqPusIoFIDSX3E4KAuPCuQDQojW6slN6AoIJJ-U.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/tZ5iPXN6G9X1ixL0WHs-uh5VAqziiY6UW-Z2hvUF6Yk.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uWSNrNOkPR4BhWrOxXX5TfqNlJIbszyfZtHnTTKZ9cg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uduw2awKAS_DPp9gklbfvv2RDev7wEpenbCFDA4DNxs.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uzyaJavSCzdPUOHA5GK3am45IFBayRibD2aAssiJ38M.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vVrp5o_oj54K9Spnx5HkfJ6ga4Tm7GxFZKt4WZB8FIo.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vuecJc1nwUoDltWHnzMRV85v7LwdiSgS7ZxysZYrRdg.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/weIC5cXLvacNNF25heFbcWBeOsb2iQ-7WcBUahSrfEE.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/wvCRibnMjYfz4MGqnbW1nweqNRiPm4ATaK-ewK5ssOQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/wyL3h6Marl2JMfZYLDwQkXRdK4NuLKiCWHQm6igReZ4.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/x0Q5Wf3UaFu2wIgP9JPFAVuYUi0n-xY58FuBZ-0O2xI.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xCb6Q2JAt2SWDS5ibOqetMJWKJm1BdJXdfAdLfLXYVc.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xkckYJjDSntINUKHZDIlrd09lKxhlFZdN7bT8Q0E1iE.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xoHo4y-EuHmK9O3z662PKRsIZpkyFW4KFE0JA6Bp3w8.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/y5iLcw4EhWkb07ULRjXL7JsXk9-lj40vgPx1f3nlXeY.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/y8ezrzwP5d8BLJ61T6L_Q4pitouvrbICokHEnxXC1ao.cache +2 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yAZJ5fnLUjXfVQXlEOoO_EszVleGJC2-Lg6z7_9KvBI.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yThvUcySW81LnX3krwb-Uhi7OEIn0LrQo5jJVQxm-N0.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yXXUoKEykhpZPMXWVzUf3GtTwgAtNSDCOK6TvomSdoM.cache +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/zsJ7Mb8REasrj4nUuq6H0d0o74xxuUlQk7KtCJSdqMg.cache +1 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/zwqXp6G2mEvMWMFcZeiFfb2jr3PymMGXDPQdfjBCrR0.cache +1 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/lib/generators/crud_generator_test.rb +14 -0
- data/test/templus_models_test.rb +7 -0
- data/test/test_helper.rb +18 -0
- metadata +693 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
class Ability
|
2
|
+
include CanCan::Ability
|
3
|
+
|
4
|
+
def initialize(usuario)
|
5
|
+
# usuario ||= Usuario.new
|
6
|
+
#
|
7
|
+
# alias_action :index, :show, :to => :read
|
8
|
+
# alias_action :new, :to => :create
|
9
|
+
# alias_action :edit, :to => :update
|
10
|
+
# # alias_action :limpar, :to => :create_or_update
|
11
|
+
# # alias_action :destroy_selected, :to => :destroy
|
12
|
+
#
|
13
|
+
# if usuario.root?
|
14
|
+
# can :manage, :all
|
15
|
+
# else
|
16
|
+
# #Permissão global
|
17
|
+
# can :manage, Dashboard
|
18
|
+
#
|
19
|
+
# # #Permissão fixa
|
20
|
+
# # case usuario.papel.chave
|
21
|
+
# # when "admin"
|
22
|
+
# # end
|
23
|
+
#
|
24
|
+
# #Permissão dinamica
|
25
|
+
# usuario.papel.permissoes.each do |permissao|
|
26
|
+
# if usuario.papel.reference_id.present? && permissao.klass.constantize.method_defined?(:reference_id)
|
27
|
+
# can permissao.abilities, permissao.klass.constantize
|
28
|
+
# else
|
29
|
+
# can permissao.abilities, permissao.klass.constantize, reference_id: usuario.papel.reference_id
|
30
|
+
# end
|
31
|
+
# end
|
32
|
+
# end
|
33
|
+
#Condições especificas de autorização
|
34
|
+
end
|
35
|
+
end
|
File without changes
|
@@ -0,0 +1,50 @@
|
|
1
|
+
class <%=nome%>Crud < RaroCrud
|
2
|
+
titulo "<%nome.pluralize%>"
|
3
|
+
subtitulo "Subtitulo", :index
|
4
|
+
|
5
|
+
descricao "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", :index
|
6
|
+
|
7
|
+
link_superior "Novo <%=nome%>", id: "novo-button", icon: "plus", link: "new"
|
8
|
+
|
9
|
+
ordenar_por :created_at
|
10
|
+
itens_por_pagina 5
|
11
|
+
|
12
|
+
#Exemplo de acao customizada
|
13
|
+
#acoes :associar, "Definir permissões", Proc.new {|p| Usuario.current.ability.can?(:create,p)}
|
14
|
+
|
15
|
+
#Campos mostrados na index
|
16
|
+
<%campos.each do |campo| %>
|
17
|
+
campo_tabela <%=campo.to_sym%>, label: "<%=campo.humanize%>"
|
18
|
+
<%end
|
19
|
+
|
20
|
+
#Campos mostrados no formulários de cadastro
|
21
|
+
<%campos.each do |campo| %>
|
22
|
+
campo_formulario <%=campo.to_sym%>, label: "<%=campo.humanize%>"
|
23
|
+
<%end
|
24
|
+
|
25
|
+
#Campos mostrados na visualizacao
|
26
|
+
<%campos.each do |campo| %>
|
27
|
+
campo_visualizacao <%=campo.to_sym%>, label: "<%=campo.humanize%>"
|
28
|
+
<%end
|
29
|
+
|
30
|
+
#Campos mostrados na busca
|
31
|
+
<%campos.each do |campo| %>
|
32
|
+
campo_busca <%=campo.to_sym%>, label: "<%=campo.humanize%>"
|
33
|
+
<%end
|
34
|
+
|
35
|
+
#Exemplos de customizacao
|
36
|
+
# Datepicker
|
37
|
+
# campo_formulario :data, label: "Data", as: :string, input_html: {class: "datepicker"}
|
38
|
+
# Checkbox
|
39
|
+
# campo_formulario :check, label: "Check", input_html: {class: "i-checks"}
|
40
|
+
# upload
|
41
|
+
# campo_formulario :arquivo, label: "Foto", input_html: {class: "ace-input-file"}
|
42
|
+
# Relacionamento
|
43
|
+
# campo_formulario :grupos, label: "Grupos",
|
44
|
+
# label_method: :nome,
|
45
|
+
# as: :check_boxes,
|
46
|
+
# input_html: {class: "i-checks"}
|
47
|
+
# campo_busca :nome, model: 'Grupo', full_name: 'grupos_nome', label: "Nome"
|
48
|
+
# escopos
|
49
|
+
# escopos [[:maiores_que_1000, "Maiores"], [:menores_que_1000, "Menores"], [:ativos, "Ativos"], [:nao_ativos, "Desativos"]]
|
50
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Teste1Crud < RaroCrud
|
2
|
+
|
3
|
+
titulo "Teste1"
|
4
|
+
link_superior "Novo Teste1", id: "novo-button", icon: "plus", link: "new"
|
5
|
+
|
6
|
+
campo_tabela :teste, label: "Nome"
|
7
|
+
|
8
|
+
grupo_formulario :teste, [
|
9
|
+
{campo: :nome, label: "Nome"}
|
10
|
+
]
|
11
|
+
campo_visualizacao :teste, label: "Nome"
|
12
|
+
campo_busca :teste_id, label: "Nome"
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class TesteCrud < RaroCrud
|
2
|
+
|
3
|
+
titulo "Testes"
|
4
|
+
subtitulo "Subtitulo", :index
|
5
|
+
descricao "Descrição do Cadastro", :index
|
6
|
+
|
7
|
+
link_superior "Novo Teste", id: "novo-button", icon: "plus", link: "new"
|
8
|
+
|
9
|
+
ordenar_por :created_at
|
10
|
+
itens_por_pagina 20
|
11
|
+
|
12
|
+
#Exemplo de acao customizada
|
13
|
+
#acoes :associar, "Definir permissões", Proc.new {|p| Usuario.current.ability.can?(:create,p)}
|
14
|
+
|
15
|
+
|
16
|
+
#Campos mostrados na index
|
17
|
+
campo_tabela :nome, label: "Nome"
|
18
|
+
campo_tabela :created_at, label: "Created at"
|
19
|
+
campo_tabela :updated_at, label: "Updated at"
|
20
|
+
|
21
|
+
|
22
|
+
#Campos mostrados no formulários de cadastro
|
23
|
+
campo_formulario :nome, label: "Nome", if: Proc.new{|o| o.try(:nome) == "Leonardo Raro" || o.new_record?}, value: Proc.new{|o| o.object.try(:teste1).try(:descricao)}
|
24
|
+
grupo_formulario :teste1, [
|
25
|
+
{campo: :descricao, label: "Descrição"}
|
26
|
+
]
|
27
|
+
|
28
|
+
|
29
|
+
#Campos mostrados na visualizacao
|
30
|
+
campo_visualizacao :nome, label: "Nome"
|
31
|
+
campo_visualizacao :created_at, label: "Created at"
|
32
|
+
campo_visualizacao :updated_at, label: "Updated at"
|
33
|
+
|
34
|
+
|
35
|
+
#Campos mostrados na busca
|
36
|
+
campo_busca :nome, label: "Nome"
|
37
|
+
campo_busca :created_at, label: "Created at"
|
38
|
+
campo_busca :updated_at, label: "Updated at"
|
39
|
+
|
40
|
+
|
41
|
+
#Exemplos de customizacao
|
42
|
+
# Datepicker
|
43
|
+
# campo_formulario :data, label: "Data", as: :string, input_html: {class: "datepicker"}
|
44
|
+
# Checkbox
|
45
|
+
# campo_formulario :check, label: "Check", input_html: {class: "i-checks"}
|
46
|
+
# upload
|
47
|
+
# campo_formulario :arquivo, label: "Foto", input_html: {class: "ace-input-file"}
|
48
|
+
# Relacionamento
|
49
|
+
# campo_formulario :grupos, label: "Grupos",
|
50
|
+
# label_method: :nome,
|
51
|
+
# as: :check_boxes,
|
52
|
+
# input_html: {class: "i-checks"}
|
53
|
+
# campo_busca :nome, model: 'Grupo', full_name: 'grupos_nome', label: "Nome"
|
54
|
+
# escopos
|
55
|
+
# escopos [[:maiores_que_1000, "Maiores"], [:menores_que_1000, "Menores"], [:ativos, "Ativos"], [:nao_ativos, "Desativos"]]
|
56
|
+
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/test/dummy/bin/rake
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
require "templus_models"
|
7
|
+
|
8
|
+
module Dummy
|
9
|
+
class Application < Rails::Application
|
10
|
+
# Settings in config/environments/* take precedence over those specified here.
|
11
|
+
# Application configuration should go into files in config/initializers
|
12
|
+
# -- all .rb files in that directory are automatically loaded.
|
13
|
+
|
14
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
15
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
16
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
17
|
+
|
18
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
19
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
20
|
+
# config.i18n.default_locale = :de
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Adds additional error checking when serving assets at runtime.
|
31
|
+
# Checks for improperly declared sprockets dependencies.
|
32
|
+
# Raises helpful error messages.
|
33
|
+
config.assets.raise_runtime_errors = true
|
34
|
+
|
35
|
+
config.assets.precompile += %w(crud/*)
|
36
|
+
|
37
|
+
# Raises error for missing translations
|
38
|
+
# config.action_view.raise_on_missing_translations = true
|
39
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
+
config.serve_static_assets = false
|
24
|
+
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
28
|
+
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
+
config.assets.compile = false
|
31
|
+
|
32
|
+
# Generate digests for assets URLs.
|
33
|
+
config.assets.digest = true
|
34
|
+
|
35
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
36
|
+
|
37
|
+
# Specifies the header that your server uses for sending files.
|
38
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
39
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
40
|
+
|
41
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
42
|
+
# config.force_ssl = true
|
43
|
+
|
44
|
+
# Set to :debug to see everything in the log.
|
45
|
+
config.log_level = :info
|
46
|
+
|
47
|
+
# Prepend all log lines with the following tags.
|
48
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
49
|
+
|
50
|
+
# Use a different logger for distributed setups.
|
51
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
52
|
+
|
53
|
+
# Use a different cache store in production.
|
54
|
+
# config.cache_store = :mem_cache_store
|
55
|
+
|
56
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
57
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
58
|
+
|
59
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
60
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
61
|
+
# config.action_mailer.raise_delivery_errors = false
|
62
|
+
|
63
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
64
|
+
# the I18n.default_locale when a translation cannot be found).
|
65
|
+
config.i18n.fallbacks = true
|
66
|
+
|
67
|
+
# Send deprecation notices to registered listeners.
|
68
|
+
config.active_support.deprecation = :notify
|
69
|
+
|
70
|
+
# Disable automatic flushing of the log to improve performance.
|
71
|
+
# config.autoflush_log = false
|
72
|
+
|
73
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
74
|
+
config.log_formatter = ::Logger::Formatter.new
|
75
|
+
|
76
|
+
# Do not dump schema after migrations.
|
77
|
+
config.active_record.dump_schema_after_migration = false
|
78
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
14
|
+
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_assets = true
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
18
|
+
|
19
|
+
# Show full error reports and disable caching.
|
20
|
+
config.consider_all_requests_local = true
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
24
|
+
config.action_dispatch.show_exceptions = false
|
25
|
+
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
|
+
|
29
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
+
# The :test delivery method accumulates sent emails in the
|
31
|
+
# ActionMailer::Base.deliveries array.
|
32
|
+
config.action_mailer.delivery_method = :test
|
33
|
+
|
34
|
+
# Print deprecation notices to the stderr.
|
35
|
+
config.active_support.deprecation = :stderr
|
36
|
+
|
37
|
+
# Raises error for missing translations
|
38
|
+
# config.action_view.raise_on_missing_translations = true
|
39
|
+
end
|