underworld 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE +339 -0
- data/Rakefile +48 -0
- data/app/assets/fonts/DroidNaskh-Bold.ttf +0 -0
- data/app/assets/fonts/DroidNaskh-Regular.ttf +0 -0
- data/app/assets/fonts/OpenSans-Bold.ttf +0 -0
- data/app/assets/fonts/OpenSans-BoldItalic.ttf +0 -0
- data/app/assets/fonts/OpenSans-ExtraBold.ttf +0 -0
- data/app/assets/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- data/app/assets/fonts/OpenSans-Italic.ttf +0 -0
- data/app/assets/fonts/OpenSans-Light.ttf +0 -0
- data/app/assets/fonts/OpenSans-LightItalic.ttf +0 -0
- data/app/assets/fonts/OpenSans-Regular.ttf +0 -0
- data/app/assets/fonts/OpenSans-Semibold.ttf +0 -0
- data/app/assets/fonts/OpenSans-SemiboldItalic.ttf +0 -0
- data/app/assets/images/underworld/select2-spinner.gif +0 -0
- data/app/assets/images/underworld/select2.png +0 -0
- data/app/assets/images/underworld/select2x2.png +0 -0
- data/app/assets/javascripts/underworld/application.js +16 -0
- data/app/assets/javascripts/underworld/dashboard/application.js.erb +30 -0
- data/app/assets/javascripts/underworld/dashboard/functions.js.erb +50 -0
- data/app/assets/javascripts/underworld/dashboard/init.js.coffee +33 -0
- data/app/assets/javascripts/underworld/dashboard/lib/actions.js +7 -0
- data/app/assets/javascripts/underworld/dashboard/lib/amd.js.coffee.erb +0 -0
- data/app/assets/javascripts/underworld/dashboard/lib/flash_message.js +71 -0
- data/app/assets/javascripts/underworld/dashboard/lib/locale.js +14 -0
- data/app/assets/javascripts/underworld/dashboard/lib/misc.js +5 -0
- data/app/assets/javascripts/underworld/dashboard/lib/string.js +3 -0
- data/app/assets/javascripts/underworld/dashboard/lib/ujs_patches.js.coffee +28 -0
- data/app/assets/javascripts/underworld/dashboard/manifest.js +5 -0
- data/app/assets/javascripts/underworld/dashboard/variables.js.erb +6 -0
- data/app/assets/javascripts/underworld/groups.js +2 -0
- data/app/assets/javascripts/underworld/home.js +2 -0
- data/app/assets/javascripts/underworld/i18n.js +13 -0
- data/app/assets/javascripts/underworld/simple.js +20 -0
- data/app/assets/javascripts/underworld/users.js +2 -0
- data/app/assets/stylesheets/underworld/dashboard/loadindicator.scss +17 -0
- data/app/assets/stylesheets/underworld/dashboard/ltr/application.css +38 -0
- data/app/assets/stylesheets/underworld/dashboard/ltr/base.css.scss +0 -0
- data/app/assets/stylesheets/underworld/dashboard/rtl/application.css +11 -0
- data/app/assets/stylesheets/underworld/dashboard/rtl/base.css.scss +0 -0
- data/app/assets/stylesheets/underworld/dashboard/share.scss +62 -0
- data/app/assets/stylesheets/underworld/dashboard/variables.scss +9 -0
- data/app/assets/stylesheets/underworld/ltr/application.css +0 -0
- data/app/assets/stylesheets/underworld/rtl/application.css +0 -0
- data/app/assets/stylesheets/underworld/simple/ltr/application.css +2 -0
- data/app/assets/stylesheets/underworld/simple/rtl/application.css +2 -0
- data/app/assets/stylesheets/underworld/simple/rtl/rtl.scss +16 -0
- data/app/assets/stylesheets/underworld/simple/share.scss +11 -0
- data/app/controllers/underworld/api_controller.rb +133 -0
- data/app/controllers/underworld/application_controller.rb +16 -0
- data/app/controllers/underworld/assets_controller.rb +6 -0
- data/app/controllers/underworld/dashboard/application_controller.rb +43 -0
- data/app/controllers/underworld/dashboard/groups_controller.rb +85 -0
- data/app/controllers/underworld/dashboard/profile_controller.rb +49 -0
- data/app/controllers/underworld/dashboard/user_messages_controller.rb +27 -0
- data/app/controllers/underworld/dashboard/users_controller.rb +116 -0
- data/app/controllers/underworld/dashboard_controller.rb +16 -0
- data/app/controllers/underworld/omniauth/callbacks_controller.rb +24 -0
- data/app/helpers/underworld/application_helper.rb +4 -0
- data/app/helpers/underworld/dashboard_helper.rb +107 -0
- data/app/helpers/underworld/groups_helper.rb +4 -0
- data/app/helpers/underworld/home_helper.rb +4 -0
- data/app/helpers/underworld/users_helper.rb +8 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/underworld/concerns/assignment.rb +16 -0
- data/app/models/underworld/concerns/user/auth_definitions.rb +87 -0
- data/app/models/underworld/concerns/user/gravatar.rb +11 -0
- data/app/models/underworld/concerns/user/mongoid_fields.rb +81 -0
- data/app/models/underworld/concerns/user/permission.rb +47 -0
- data/app/models/underworld/concerns/user/user_roles.rb +24 -0
- data/app/models/underworld/group.rb +57 -0
- data/app/models/underworld/permission.rb +43 -0
- data/app/models/underworld/user.rb +81 -0
- data/app/models/underworld/user_message.rb +6 -0
- data/app/policies/underworld/admin_only_policy.rb +66 -0
- data/app/policies/underworld/application_policy.rb +55 -0
- data/app/policies/underworld/group_policy.rb +8 -0
- data/app/policies/underworld/user_message_policy.rb +9 -0
- data/app/policies/underworld/user_policy.rb +9 -0
- data/app/views/angular/auth/groups/details.html +2 -0
- data/app/views/angular/auth/groups/index.html +2 -0
- data/app/views/angular/auth/groups/new.html +2 -0
- data/app/views/angular/auth/index.html +30 -0
- data/app/views/angular/auth/profile/edit.html +54 -0
- data/app/views/angular/auth/users/details.html +28 -0
- data/app/views/angular/auth/users/index.html +6 -0
- data/app/views/angular/auth/users/new.html +57 -0
- data/app/views/angular/conversations/details.html +19 -0
- data/app/views/angular/conversations/index.html +13 -0
- data/app/views/angular/conversations/new.html +39 -0
- data/app/views/angular/conversations/show.html +6 -0
- data/app/views/angular/conversations/show_details.html +15 -0
- data/app/views/angular/fields/boolean/boolean.html +4 -0
- data/app/views/angular/fields/control-combo/control-list.html +19 -0
- data/app/views/angular/fields/datetime/datetime.html +10 -0
- data/app/views/angular/fields/datetime/time.html +25 -0
- data/app/views/angular/fields/file/file.html.slim +0 -0
- data/app/views/angular/fields/float/float.html +4 -0
- data/app/views/angular/fields/image/image.html +1 -0
- data/app/views/angular/fields/integer/integer.html +4 -0
- data/app/views/angular/fields/relation/relation.html +44 -0
- data/app/views/angular/fields/string/string.html +22 -0
- data/app/views/angular/fields/tag/tag.html +1 -0
- data/app/views/angular/fields/text/text.html +4 -0
- data/app/views/angular/filter/index.html +15 -0
- data/app/views/angular/index.html +3 -0
- data/app/views/angular/locale/fa.po +25 -0
- data/app/views/angular/locale/templates.pot +24 -0
- data/app/views/angular/logs/index.html +6 -0
- data/app/views/angular/modules.html +0 -0
- data/app/views/angular/nav.html.erb +39 -0
- data/app/views/angular/underworld/views/generic_add_view.html.slim +5 -0
- data/app/views/devise/registrations/edit.html.erb +29 -0
- data/app/views/devise/registrations/new.html.erb +38 -0
- data/app/views/devise/sessions/new.html.erb +37 -0
- data/app/views/devise/shared/_links.erb +19 -0
- data/app/views/devise/shared/_omni_link.erb +33 -0
- data/app/views/kaminari/_first_page.html.slim +3 -0
- data/app/views/kaminari/_gap.html.slim +2 -0
- data/app/views/kaminari/_last_page.html.slim +3 -0
- data/app/views/kaminari/_next_page.html.slim +3 -0
- data/app/views/kaminari/_page.html.slim +3 -0
- data/app/views/kaminari/_paginator.html.slim +13 -0
- data/app/views/kaminari/_prev_page.html.slim +3 -0
- data/app/views/layouts/underworld/application.html.erb +79 -0
- data/app/views/layouts/underworld/dashboard.html.erb +52 -0
- data/app/views/layouts/underworld/simple.html.erb +27 -0
- data/app/views/underworld/api/v1/conversations/create.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/destroy.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/index.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/reply.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/show.json.jbuilder +14 -0
- data/app/views/underworld/api/v1/conversations/trash.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/groups/create.json.jbuilder +4 -0
- data/app/views/underworld/api/v1/groups/destroy.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/destroy.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/groups/edit.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/index.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/index.json.jbuilder +6 -0
- data/app/views/underworld/api/v1/groups/new.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/show.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/show.json.jbuilder +5 -0
- data/app/views/underworld/api/v1/groups/update.json.jbuilder +4 -0
- data/app/views/underworld/api/v1/logs/index.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/permissions/index.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/permissions/user_permissions.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/users/create.html.erb +2 -0
- data/app/views/underworld/api/v1/users/create.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/users/destroy.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/users/distroy.html.erb +2 -0
- data/app/views/underworld/api/v1/users/edit.html.erb +2 -0
- data/app/views/underworld/api/v1/users/index.html.erb +2 -0
- data/app/views/underworld/api/v1/users/index.json.jbuilder +4 -0
- data/app/views/underworld/api/v1/users/show.html.erb +2 -0
- data/app/views/underworld/api/v1/users/show.json.jbuilder +2 -0
- data/app/views/underworld/api/v1/users/update.json.jbuilder +1 -0
- data/app/views/underworld/dashboard/groups/_form.html.slim +68 -0
- data/app/views/underworld/dashboard/groups/create.js.erb +3 -0
- data/app/views/underworld/dashboard/groups/edit.html.slim +3 -0
- data/app/views/underworld/dashboard/groups/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/groups/index.html.slim +47 -0
- data/app/views/underworld/dashboard/groups/new.html.slim +2 -0
- data/app/views/underworld/dashboard/groups/update.js.erb +3 -0
- data/app/views/underworld/dashboard/index.html.erb +0 -0
- data/app/views/underworld/dashboard/login_required_page.html.erb +5 -0
- data/app/views/underworld/dashboard/not_found.html.slim +9 -0
- data/app/views/underworld/dashboard/not_found.js.erb +1 -0
- data/app/views/underworld/dashboard/profile/_form.html.erb +33 -0
- data/app/views/underworld/dashboard/profile/_profile_form.html.erb +33 -0
- data/app/views/underworld/dashboard/profile/create.js.erb +3 -0
- data/app/views/underworld/dashboard/profile/edit.html.erb +2 -0
- data/app/views/underworld/dashboard/profile/edit_password.html.erb +2 -0
- data/app/views/underworld/dashboard/profile/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/resource/_form.html.slim +33 -0
- data/app/views/underworld/dashboard/resource/_input.html.slim +3 -0
- data/app/views/underworld/dashboard/resource/create.js.erb +3 -0
- data/app/views/underworld/dashboard/resource/destroy.js.erb +2 -0
- data/app/views/underworld/dashboard/resource/edit.html.slim +3 -0
- data/app/views/underworld/dashboard/resource/index.html.slim +60 -0
- data/app/views/underworld/dashboard/resource/new.html.slim +2 -0
- data/app/views/underworld/dashboard/resource/show.html.slim +22 -0
- data/app/views/underworld/dashboard/resource/update.js.erb +3 -0
- data/app/views/underworld/dashboard/shared/_content_header.html.slim +15 -0
- data/app/views/underworld/dashboard/shared/_control_sidebar.html.slim +50 -0
- data/app/views/underworld/dashboard/shared/_footer.html.slim +7 -0
- data/app/views/underworld/dashboard/shared/_header.html.erb +98 -0
- data/app/views/underworld/dashboard/shared/_sidebar.html.erb +69 -0
- data/app/views/underworld/dashboard/shared/_toolbar.html.slim +0 -0
- data/app/views/underworld/dashboard/shared/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/user_messages/_form.html.slim +0 -0
- data/app/views/underworld/dashboard/user_messages/create.js.erb +0 -0
- data/app/views/underworld/dashboard/user_messages/destroy.js.erb +0 -0
- data/app/views/underworld/dashboard/user_messages/new.html.slim +72 -0
- data/app/views/underworld/dashboard/users/_form.html.slim +73 -0
- data/app/views/underworld/dashboard/users/_password_form.html.slim +37 -0
- data/app/views/underworld/dashboard/users/create.js.erb +3 -0
- data/app/views/underworld/dashboard/users/destroy.js.erb +2 -0
- data/app/views/underworld/dashboard/users/edit.html.slim +3 -0
- data/app/views/underworld/dashboard/users/edit_password.html.slim +1 -0
- data/app/views/underworld/dashboard/users/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/users/index.html.slim +66 -0
- data/app/views/underworld/dashboard/users/new.html.slim +2 -0
- data/app/views/underworld/dashboard/users/show.html.slim +6 -0
- data/app/views/underworld/dashboard/users/update.js.erb +3 -0
- data/app/views/underworld/dashboard/users/update_password.js.erb +3 -0
- data/app/views/underworld/relations/_belongs_to.json.jbuilder +11 -0
- data/config/initializers/devise.rb +24 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/devise.fa.yml +58 -0
- data/config/locales/underworld.en.yml +96 -0
- data/config/locales/underworld.fa.yml +108 -0
- data/config/routes.rb +43 -0
- data/config/spring.rb +1 -0
- data/db/migrate/20131013091000_devise_create_underworld_users.rb +65 -0
- data/db/migrate/20131020124701_create_underworld_groups.rb +15 -0
- data/db/migrate/20131021170923_create_underworld_permissions.rb +15 -0
- data/db/migrate/20131123120422_add_permissions_groups_table.rb +16 -0
- data/db/migrate/20140613120923_add_users_groups_table.rb +13 -0
- data/db/migrate/20151122115129_add_uniqueness_index_to_users_groups.rb +11 -0
- data/db/migrate/20160310105736_create_underworld_user_messages.rb +25 -0
- data/db/seeds.rb +49 -0
- data/lib/generators/underworld/install_generator.rb +108 -0
- data/lib/generators/underworld/resource_generator.rb +70 -0
- data/lib/generators/underworld/resources_generator.rb +20 -0
- data/lib/generators/underworld/templates/README +21 -0
- data/lib/generators/underworld/templates/SPECS +13 -0
- data/lib/generators/underworld/templates/api/controller.rb.erb +60 -0
- data/lib/generators/underworld/templates/api_controller.rb +2 -0
- data/lib/generators/underworld/templates/dashboard/controller.rb.erb +2 -0
- data/lib/generators/underworld/templates/dashboard_controller.rb +18 -0
- data/lib/generators/underworld/templates/devise.rb +251 -0
- data/lib/generators/underworld/templates/features/api.feature +92 -0
- data/lib/generators/underworld/templates/features/api.step.rb +7 -0
- data/lib/generators/underworld/templates/features/step_definitions/email_steps.rb +206 -0
- data/lib/generators/underworld/templates/features/support/email_spec.rb +1 -0
- data/lib/generators/underworld/templates/features/support/env.rb +79 -0
- data/lib/generators/underworld/templates/javascripts/application.js +19 -0
- data/lib/generators/underworld/templates/policy/application_policy.rb +2 -0
- data/lib/generators/underworld/templates/policy/policy.rb.erb +2 -0
- data/lib/generators/underworld/templates/seeds.rb +1 -0
- data/lib/generators/underworld/templates/spec/factories/groups.rb +5 -0
- data/lib/generators/underworld/templates/spec/factories/users.rb +10 -0
- data/lib/generators/underworld/templates/spec/spec_helper.rb +69 -0
- data/lib/generators/underworld/templates/spec/support/devise.rb +3 -0
- data/lib/generators/underworld/templates/stylesheets/dashboard/ltr/application.css +3 -0
- data/lib/generators/underworld/templates/stylesheets/dashboard/rtl/application.css +3 -0
- data/lib/generators/underworld/templates/stylesheets/ltr/application.css +3 -0
- data/lib/generators/underworld/templates/stylesheets/rtl/application.css +3 -0
- data/lib/generators/underworld/templates/underworld.rb +12 -0
- data/lib/generators/underworld/templates/views/create.json.jbuilder.erb +3 -0
- data/lib/generators/underworld/templates/views/destroy.json.jbuilder.erb +1 -0
- data/lib/generators/underworld/templates/views/index.json.jbuilder.erb +13 -0
- data/lib/generators/underworld/templates/views/show.json.jbuilder.erb +6 -0
- data/lib/generators/underworld/templates/views/update.json.jbuilder.erb +6 -0
- data/lib/generators/underworld/views_generator.rb +57 -0
- data/lib/tasks/docs.rake +6 -0
- data/lib/tasks/sync.rake +9 -0
- data/lib/tasks/underworld_tasks.rake +38 -0
- data/lib/underworld.rb +35 -0
- data/lib/underworld/action_dispatch.rb +3 -0
- data/lib/underworld/api.rb +42 -0
- data/lib/underworld/api/groups_api.rb +41 -0
- data/lib/underworld/api/permissions_api.rb +24 -0
- data/lib/underworld/api/root.rb +15 -0
- data/lib/underworld/api/users_api.rb +20 -0
- data/lib/underworld/concerns.rb +7 -0
- data/lib/underworld/concerns/authorizable.rb +81 -0
- data/lib/underworld/configuration.rb +97 -0
- data/lib/underworld/dashboard.rb +11 -0
- data/lib/underworld/dashboard/dsl.rb +41 -0
- data/lib/underworld/dashboard/dsl/base.rb +133 -0
- data/lib/underworld/dashboard/dsl/create.rb +116 -0
- data/lib/underworld/dashboard/dsl/form_fields_properties.rb +62 -0
- data/lib/underworld/dashboard/dsl/index.rb +45 -0
- data/lib/underworld/dashboard/dsl/show.rb +6 -0
- data/lib/underworld/dashboard/dsl/update.rb +6 -0
- data/lib/underworld/dashboard/helpers/box_helpers.rb +129 -0
- data/lib/underworld/dashboard/models.rb +2 -0
- data/lib/underworld/dashboard/models/sidebar.rb +139 -0
- data/lib/underworld/dashboard/sections.rb +2 -0
- data/lib/underworld/dashboard/sections/resource.rb +229 -0
- data/lib/underworld/dashboard/sections/resource_create.rb +263 -0
- data/lib/underworld/dashboard/sections/resource_destroy.rb +27 -0
- data/lib/underworld/dashboard/sections/resource_show.rb +96 -0
- data/lib/underworld/dashboard/sections/resources_index.rb +113 -0
- data/lib/underworld/dashboard/sections/sidebar.rb +41 -0
- data/lib/underworld/discovery.rb +8 -0
- data/lib/underworld/discovery/permissions.rb +49 -0
- data/lib/underworld/engine.rb +53 -0
- data/lib/underworld/exceptions.rb +7 -0
- data/lib/underworld/extension.rb +18 -0
- data/lib/underworld/extension/base.rb +29 -0
- data/lib/underworld/fake_assets.rb +5 -0
- data/lib/underworld/i18n.rb +101 -0
- data/lib/underworld/initialize.rb +0 -0
- data/lib/underworld/liquid.rb +7 -0
- data/lib/underworld/liquid/block.rb +14 -0
- data/lib/underworld/liquid/render_tag.rb +50 -0
- data/lib/underworld/liquid/tag.rb +51 -0
- data/lib/underworld/middlewares.rb +1 -0
- data/lib/underworld/middlewares/locale.rb +29 -0
- data/lib/underworld/omniauth.rb +8 -0
- data/lib/underworld/omniauth/callbacks.rb +39 -0
- data/lib/underworld/orm.rb +30 -0
- data/lib/underworld/routes.rb +117 -0
- data/lib/underworld/version.rb +3 -0
- data/test/controllers/underworld/dashboard/resource_test.rb +118 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/javascripts/dashboard/application.js +19 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/assets/stylesheets/dashboard/ltr/application.css +3 -0
- data/test/dummy/app/assets/stylesheets/dashboard/rtl/application.css +3 -0
- data/test/dummy/app/assets/stylesheets/ltr/application.css +3 -0
- data/test/dummy/app/assets/stylesheets/rtl/application.css +3 -0
- data/test/dummy/app/controllers/api_controller.rb +2 -0
- data/test/dummy/app/controllers/application_controller.rb +6 -0
- data/test/dummy/app/controllers/dashboard/application_controller.rb +18 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/policies/application_policy.rb +2 -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 +29 -0
- data/test/dummy/config/environments/production.rb +80 -0
- data/test/dummy/config/environments/test.rb +38 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +251 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/formstatic.rb +76 -0
- data/test/dummy/config/initializers/formtastic.rb +110 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/kaminari_config.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/underworld.rb +11 -0
- data/test/dummy/config/initializers/underworld_assets.rb +1 -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 +13 -0
- data/test/dummy/lib/templates/slim/scaffold/_form.html.slim +8 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fabricators/underworld/groups.rb +27 -0
- data/test/fabricators/underworld/permissions.rb +14 -0
- data/test/fabricators/underworld/users.rb +17 -0
- data/test/generators/install_generator_test.rb +84 -0
- data/test/integration/underworld/authentication_test.rb +36 -0
- data/test/integration/underworld/dashboard_test.rb +64 -0
- data/test/test_helper.rb +72 -0
- metadata +1045 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
Dummy::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_files = 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
|
+
config.active_support.test_order = :sorted
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,251 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# The secret key used by Devise. Devise uses this key to generate
|
5
|
+
# random tokens. Changing this key will render invalid all existing
|
6
|
+
# confirmation, reset password and unlock tokens in the database.
|
7
|
+
config.secret_key = '792f174c41574b8e7ed2895d2687cb6a6fe44be83d4328479f6e38d5e3dfa7d4806e71b81297351d9f55073c45293390ab98ab26b5ae69998e0757e57626415b'
|
8
|
+
|
9
|
+
# ==> Mailer Configuration
|
10
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
11
|
+
# note that it will be overwritten if you use your own mailer class
|
12
|
+
# with default "from" parameter.
|
13
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
14
|
+
|
15
|
+
# Configure the class responsible to send e-mails.
|
16
|
+
# config.mailer = 'Devise::Mailer'
|
17
|
+
|
18
|
+
# ==> ORM configuration
|
19
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
20
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
21
|
+
# available as additional gems.
|
22
|
+
require 'devise/orm/active_record'
|
23
|
+
|
24
|
+
# ==> Configuration for any authentication mechanism
|
25
|
+
# Configure which keys are used when authenticating a user. The default is
|
26
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
27
|
+
# authenticating a user, both parameters are required. Remember that those
|
28
|
+
# parameters are used only when authenticating and not when retrieving from
|
29
|
+
# session. If you need permissions, you should implement that in a before filter.
|
30
|
+
# You can also supply a hash where the value is a boolean determining whether
|
31
|
+
# or not authentication should be aborted when the value is not present.
|
32
|
+
# config.authentication_keys = [ :email ]
|
33
|
+
|
34
|
+
# Configure parameters from the request object used for authentication. Each entry
|
35
|
+
# given should be a request method and it will automatically be passed to the
|
36
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
37
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
38
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
39
|
+
# config.request_keys = []
|
40
|
+
|
41
|
+
# Configure which authentication keys should be case-insensitive.
|
42
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
43
|
+
# to authenticate or find a user. Default is :email.
|
44
|
+
config.case_insensitive_keys = [ :email ]
|
45
|
+
|
46
|
+
# Configure which authentication keys should have whitespace stripped.
|
47
|
+
# These keys will have whitespace before and after removed upon creating or
|
48
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
49
|
+
config.strip_whitespace_keys = [ :email ]
|
50
|
+
|
51
|
+
# Tell if authentication through request.params is enabled. True by default.
|
52
|
+
# It can be set to an array that will enable params authentication only for the
|
53
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
54
|
+
# enable it only for database (email + password) authentication.
|
55
|
+
# config.params_authenticatable = true
|
56
|
+
|
57
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
58
|
+
# It can be set to an array that will enable http authentication only for the
|
59
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
60
|
+
# enable it only for database authentication. The supported strategies are:
|
61
|
+
# :database = Support basic authentication with authentication key + password
|
62
|
+
# config.http_authenticatable = false
|
63
|
+
|
64
|
+
# If http headers should be returned for AJAX requests. True by default.
|
65
|
+
# config.http_authenticatable_on_xhr = true
|
66
|
+
|
67
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
68
|
+
# config.http_authentication_realm = 'Application'
|
69
|
+
|
70
|
+
# It will change confirmation, password recovery and other workflows
|
71
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
72
|
+
# Does not affect registerable.
|
73
|
+
# config.paranoid = true
|
74
|
+
|
75
|
+
# By default Devise will store the user in session. You can skip storage for
|
76
|
+
# particular strategies by setting this option.
|
77
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
78
|
+
# may want to disable generating routes to Devise's sessions controller by
|
79
|
+
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
80
|
+
config.skip_session_storage = [:http_auth]
|
81
|
+
|
82
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
83
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
84
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
85
|
+
# from the server. You can disable this option at your own risk.
|
86
|
+
# config.clean_up_csrf_token_on_authentication = true
|
87
|
+
|
88
|
+
# ==> Configuration for :database_authenticatable
|
89
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
90
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
91
|
+
#
|
92
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
93
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
94
|
+
# a value less than 10 in other environments.
|
95
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
96
|
+
|
97
|
+
# Setup a pepper to generate the encrypted password.
|
98
|
+
# config.pepper = '5d04794a00e9970da62ebe7c0103b04f244fdc65c818f2f792849d96c75655205c06ea8866b54dd83a8d0cfe8b550137e9a5eb9a466659b7ffdd5047ed06ed7e'
|
99
|
+
|
100
|
+
# ==> Configuration for :confirmable
|
101
|
+
# A period that the user is allowed to access the website even without
|
102
|
+
# confirming his account. For instance, if set to 2.days, the user will be
|
103
|
+
# able to access the website for two days without confirming his account,
|
104
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
105
|
+
# the user cannot access the website without confirming his account.
|
106
|
+
# config.allow_unconfirmed_access_for = 2.days
|
107
|
+
|
108
|
+
# A period that the user is allowed to confirm their account before their
|
109
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
110
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
111
|
+
# their account can't be confirmed with the token any more.
|
112
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
113
|
+
# before confirming their account.
|
114
|
+
# config.confirm_within = 3.days
|
115
|
+
|
116
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
117
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
118
|
+
# db field (see migrations). Until confirmed new email is stored in
|
119
|
+
# unconfirmed email column, and copied to email column on successful confirmation.
|
120
|
+
config.reconfirmable = true
|
121
|
+
|
122
|
+
# Defines which key will be used when confirming an account
|
123
|
+
# config.confirmation_keys = [ :email ]
|
124
|
+
|
125
|
+
# ==> Configuration for :rememberable
|
126
|
+
# The time the user will be remembered without asking for credentials again.
|
127
|
+
# config.remember_for = 2.weeks
|
128
|
+
|
129
|
+
# If true, extends the user's remember period when remembered via cookie.
|
130
|
+
# config.extend_remember_period = false
|
131
|
+
|
132
|
+
# Options to be passed to the created cookie. For instance, you can set
|
133
|
+
# :secure => true in order to force SSL only cookies.
|
134
|
+
# config.rememberable_options = {}
|
135
|
+
|
136
|
+
# ==> Configuration for :validatable
|
137
|
+
# Range for password length. Default is 8..128.
|
138
|
+
config.password_length = 8..128
|
139
|
+
|
140
|
+
# Email regex used to validate email formats. It simply asserts that
|
141
|
+
# one (and only one) @ exists in the given string. This is mainly
|
142
|
+
# to give user feedback and not to assert the e-mail validity.
|
143
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
144
|
+
|
145
|
+
# ==> Configuration for :timeoutable
|
146
|
+
# The time you want to timeout the user session without activity. After this
|
147
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
148
|
+
# config.timeout_in = 30.minutes
|
149
|
+
|
150
|
+
# If true, expires auth token on session timeout.
|
151
|
+
# config.expire_auth_token_on_timeout = false
|
152
|
+
|
153
|
+
# ==> Configuration for :lockable
|
154
|
+
# Defines which strategy will be used to lock an account.
|
155
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
156
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
157
|
+
# config.lock_strategy = :failed_attempts
|
158
|
+
|
159
|
+
# Defines which key will be used when locking and unlocking an account
|
160
|
+
# config.unlock_keys = [ :email ]
|
161
|
+
|
162
|
+
# Defines which strategy will be used to unlock an account.
|
163
|
+
# :email = Sends an unlock link to the user email
|
164
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
165
|
+
# :both = Enables both strategies
|
166
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
167
|
+
# config.unlock_strategy = :both
|
168
|
+
|
169
|
+
# Number of authentication tries before locking an account if lock_strategy
|
170
|
+
# is failed attempts.
|
171
|
+
# config.maximum_attempts = 20
|
172
|
+
|
173
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
174
|
+
# config.unlock_in = 1.hour
|
175
|
+
|
176
|
+
# ==> Configuration for :recoverable
|
177
|
+
#
|
178
|
+
# Defines which key will be used when recovering the password for an account
|
179
|
+
# config.reset_password_keys = [ :email ]
|
180
|
+
|
181
|
+
# Time interval you can reset your password with a reset password key.
|
182
|
+
# Don't put a too small interval or your users won't have the time to
|
183
|
+
# change their passwords.
|
184
|
+
config.reset_password_within = 6.hours
|
185
|
+
|
186
|
+
# ==> Configuration for :encryptable
|
187
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
188
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
189
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
190
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
191
|
+
# REST_AUTH_SITE_KEY to pepper).
|
192
|
+
#
|
193
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
194
|
+
# config.encryptor = :sha512
|
195
|
+
|
196
|
+
# ==> Scopes configuration
|
197
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
198
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
199
|
+
# are using only default views.
|
200
|
+
# config.scoped_views = false
|
201
|
+
|
202
|
+
# Configure the default scope given to Warden. By default it's the first
|
203
|
+
# devise role declared in your routes (usually :user).
|
204
|
+
# config.default_scope = :user
|
205
|
+
|
206
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
207
|
+
# only the current scope. By default, Devise signs out all scopes.
|
208
|
+
# config.sign_out_all_scopes = true
|
209
|
+
|
210
|
+
# ==> Navigation configuration
|
211
|
+
# Lists the formats that should be treated as navigational. Formats like
|
212
|
+
# :html, should redirect to the sign in page when the user does not have
|
213
|
+
# access, but formats like :xml or :json, should return 401.
|
214
|
+
#
|
215
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
216
|
+
# should add them to the navigational formats lists.
|
217
|
+
#
|
218
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
219
|
+
# config.navigational_formats = ['*/*', :html]
|
220
|
+
|
221
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
222
|
+
config.sign_out_via = :delete
|
223
|
+
|
224
|
+
# ==> OmniAuth
|
225
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
226
|
+
# up on your models and hooks.
|
227
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
228
|
+
|
229
|
+
# ==> Warden configuration
|
230
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
231
|
+
# change the failure app, you can configure them inside the config.warden block.
|
232
|
+
#
|
233
|
+
# config.warden do |manager|
|
234
|
+
# manager.intercept_401 = false
|
235
|
+
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
236
|
+
# end
|
237
|
+
|
238
|
+
# ==> Mountable engine configurations
|
239
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
240
|
+
# is mountable, there are some extra configurations to be taken into account.
|
241
|
+
# The following options are available, assuming the engine is mounted as:
|
242
|
+
#
|
243
|
+
# mount MyEngine, at: '/my_engine'
|
244
|
+
#
|
245
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
246
|
+
# config.router_name = :my_engine
|
247
|
+
#
|
248
|
+
# When using omniauth, Devise cannot automatically set Omniauth path,
|
249
|
+
# so you need to do it manually. For the users scope, it would be:
|
250
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
251
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Set the default text field size when input is a string. Default is nil.
|
4
|
+
# Formtastic::FormBuilder.default_text_field_size = 50
|
5
|
+
|
6
|
+
# Set the default text area height when input is a text. Default is 20.
|
7
|
+
# Formtastic::FormBuilder.default_text_area_height = 5
|
8
|
+
|
9
|
+
# Set the default text area width when input is a text. Default is nil.
|
10
|
+
# Formtastic::FormBuilder.default_text_area_width = 50
|
11
|
+
|
12
|
+
# Should all fields be considered "required" by default?
|
13
|
+
# Defaults to true.
|
14
|
+
# Formtastic::FormBuilder.all_fields_required_by_default = true
|
15
|
+
|
16
|
+
# Should select fields have a blank option/prompt by default?
|
17
|
+
# Defaults to true.
|
18
|
+
# Formtastic::FormBuilder.include_blank_for_select_by_default = true
|
19
|
+
|
20
|
+
# Set the string that will be appended to the labels/fieldsets which are required
|
21
|
+
# It accepts string or procs and the default is a localized version of
|
22
|
+
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
|
23
|
+
# in your locale, it will replace the abbr title properly. But if you don't want to use
|
24
|
+
# abbr tag, you can simply give a string as below
|
25
|
+
# Formtastic::FormBuilder.required_string = "(required)"
|
26
|
+
|
27
|
+
# Set the string that will be appended to the labels/fieldsets which are optional
|
28
|
+
# Defaults to an empty string ("") and also accepts procs (see required_string above)
|
29
|
+
# Formtastic::FormBuilder.optional_string = "(optional)"
|
30
|
+
|
31
|
+
# Set the way inline errors will be displayed.
|
32
|
+
# Defaults to :sentence, valid options are :sentence, :list, :first and :none
|
33
|
+
# Formtastic::FormBuilder.inline_errors = :sentence
|
34
|
+
# Formtastic uses the following classes as default for hints, inline_errors and error list
|
35
|
+
|
36
|
+
# If you override the class here, please ensure to override it in your stylesheets as well
|
37
|
+
# Formtastic::FormBuilder.default_hint_class = "inline-hints"
|
38
|
+
# Formtastic::FormBuilder.default_inline_error_class = "inline-errors"
|
39
|
+
# Formtastic::FormBuilder.default_error_list_class = "errors"
|
40
|
+
|
41
|
+
# Set the method to call on label text to transform or format it for human-friendly
|
42
|
+
# reading when formtastic is used without object. Defaults to :humanize.
|
43
|
+
# Formtastic::FormBuilder.label_str_method = :humanize
|
44
|
+
|
45
|
+
# Set the array of methods to try calling on parent objects in :select and :radio inputs
|
46
|
+
# for the text inside each @<option>@ tag or alongside each radio @<input>@. The first method
|
47
|
+
# that is found on the object will be used.
|
48
|
+
# Defaults to ["to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
49
|
+
# Formtastic::FormBuilder.collection_label_methods = [
|
50
|
+
# "to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
51
|
+
|
52
|
+
# Specifies if labels/hints for input fields automatically be looked up using I18n.
|
53
|
+
# Default value: true. Overridden for specific fields by setting value to true,
|
54
|
+
# i.e. :label => true, or :hint => true (or opposite depending on initialized value)
|
55
|
+
# Formtastic::FormBuilder.i18n_lookups_by_default = false
|
56
|
+
|
57
|
+
# Specifies if I18n lookups of the default I18n Localizer should be cached to improve performance.
|
58
|
+
# Defaults to true.
|
59
|
+
# Formtastic::FormBuilder.i18n_cache_lookups = false
|
60
|
+
|
61
|
+
# Specifies the class to use for localization lookups. You can create your own
|
62
|
+
# class and use it instead by subclassing Formtastic::Localizer (which is the default).
|
63
|
+
# Formtastic::FormBuilder.i18n_localizer = MyOwnLocalizer
|
64
|
+
|
65
|
+
# You can add custom inputs or override parts of Formtastic by subclassing Formtastic::FormBuilder and
|
66
|
+
# specifying that class here. Defaults to Formtastic::FormBuilder.
|
67
|
+
# Formtastic::Helpers::FormHelper.builder = MyCustomBuilder
|
68
|
+
|
69
|
+
# You can opt-in to Formtastic's use of the HTML5 `required` attribute on `<input>`, `<select>`
|
70
|
+
# and `<textarea>` tags by setting this to false (defaults to true).
|
71
|
+
# Formtastic::FormBuilder.use_required_attribute = true
|
72
|
+
|
73
|
+
# You can opt-in to new HTML5 browser validations (for things like email and url inputs) by setting
|
74
|
+
# this to false. Doing so will add a `novalidate` attribute to the `<form>` tag.
|
75
|
+
# See http://diveintohtml5.org/forms.html#validation for more info.
|
76
|
+
# Formtastic::FormBuilder.perform_browser_validations = true
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Set the default text field size when input is a string. Default is nil.
|
4
|
+
# Formtastic::FormBuilder.default_text_field_size = 50
|
5
|
+
|
6
|
+
# Set the default text area height when input is a text. Default is 20.
|
7
|
+
# Formtastic::FormBuilder.default_text_area_height = 5
|
8
|
+
|
9
|
+
# Set the default text area width when input is a text. Default is nil.
|
10
|
+
# Formtastic::FormBuilder.default_text_area_width = 50
|
11
|
+
|
12
|
+
# Should all fields be considered "required" by default?
|
13
|
+
# Defaults to true.
|
14
|
+
# Formtastic::FormBuilder.all_fields_required_by_default = true
|
15
|
+
|
16
|
+
# Should select fields have a blank option/prompt by default?
|
17
|
+
# Defaults to true.
|
18
|
+
# Formtastic::FormBuilder.include_blank_for_select_by_default = true
|
19
|
+
|
20
|
+
# Set the string that will be appended to the labels/fieldsets which are required
|
21
|
+
# It accepts string or procs and the default is a localized version of
|
22
|
+
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
|
23
|
+
# in your locale, it will replace the abbr title properly. But if you don't want to use
|
24
|
+
# abbr tag, you can simply give a string as below
|
25
|
+
# Formtastic::FormBuilder.required_string = "(required)"
|
26
|
+
|
27
|
+
# Set the string that will be appended to the labels/fieldsets which are optional
|
28
|
+
# Defaults to an empty string ("") and also accepts procs (see required_string above)
|
29
|
+
# Formtastic::FormBuilder.optional_string = "(optional)"
|
30
|
+
|
31
|
+
# Set the way inline errors will be displayed.
|
32
|
+
# Defaults to :sentence, valid options are :sentence, :list, :first and :none
|
33
|
+
# Formtastic::FormBuilder.inline_errors = :sentence
|
34
|
+
# Formtastic uses the following classes as default for hints, inline_errors and error list
|
35
|
+
|
36
|
+
# If you override the class here, please ensure to override it in your stylesheets as well
|
37
|
+
# Formtastic::FormBuilder.default_hint_class = "inline-hints"
|
38
|
+
# Formtastic::FormBuilder.default_inline_error_class = "inline-errors"
|
39
|
+
# Formtastic::FormBuilder.default_error_list_class = "errors"
|
40
|
+
|
41
|
+
# Set the method to call on label text to transform or format it for human-friendly
|
42
|
+
# reading when formtastic is used without object. Defaults to :humanize.
|
43
|
+
# Formtastic::FormBuilder.label_str_method = :humanize
|
44
|
+
|
45
|
+
# Set the array of methods to try calling on parent objects in :select and :radio inputs
|
46
|
+
# for the text inside each @<option>@ tag or alongside each radio @<input>@. The first method
|
47
|
+
# that is found on the object will be used.
|
48
|
+
# Defaults to ["to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
49
|
+
# Formtastic::FormBuilder.collection_label_methods = [
|
50
|
+
# "to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
51
|
+
|
52
|
+
# Specifies if labels/hints for input fields automatically be looked up using I18n.
|
53
|
+
# Default value: true. Overridden for specific fields by setting value to true,
|
54
|
+
# i.e. :label => true, or :hint => true (or opposite depending on initialized value)
|
55
|
+
# Formtastic::FormBuilder.i18n_lookups_by_default = false
|
56
|
+
|
57
|
+
# Specifies if I18n lookups of the default I18n Localizer should be cached to improve performance.
|
58
|
+
# Defaults to true.
|
59
|
+
# Formtastic::FormBuilder.i18n_cache_lookups = false
|
60
|
+
|
61
|
+
# Specifies the class to use for localization lookups. You can create your own
|
62
|
+
# class and use it instead by subclassing Formtastic::Localizer (which is the default).
|
63
|
+
# Formtastic::FormBuilder.i18n_localizer = MyOwnLocalizer
|
64
|
+
|
65
|
+
# You can add custom inputs or override parts of Formtastic by subclassing Formtastic::FormBuilder and
|
66
|
+
# specifying that class here. Defaults to Formtastic::FormBuilder.
|
67
|
+
# Formtastic::Helpers::FormHelper.builder = MyCustomBuilder
|
68
|
+
|
69
|
+
# All formtastic forms have a class that indicates that they are just that. You
|
70
|
+
# can change it to any class you want.
|
71
|
+
# Formtastic::Helpers::FormHelper.default_form_class = 'formtastic'
|
72
|
+
|
73
|
+
# Formtastic will infer a class name from the model, array, string ot symbol you pass to the
|
74
|
+
# form builder. You can customize the way that class is presented by overriding
|
75
|
+
# this proc.
|
76
|
+
# Formtastic::Helpers::FormHelper.default_form_model_class_proc = proc { |model_class_name| model_class_name }
|
77
|
+
|
78
|
+
# Allows to set a custom field_error_proc wrapper. By default this wrapper
|
79
|
+
# is disabled since `formtastic` already adds an error class to the LI tag
|
80
|
+
# containing the input.
|
81
|
+
# Formtastic::Helpers::FormHelper.formtastic_field_error_proc = proc { |html_tag, instance_tag| html_tag }
|
82
|
+
|
83
|
+
# You can opt-in to Formtastic's use of the HTML5 `required` attribute on `<input>`, `<select>`
|
84
|
+
# and `<textarea>` tags by setting this to true (defaults to false).
|
85
|
+
# Formtastic::FormBuilder.use_required_attribute = false
|
86
|
+
|
87
|
+
# You can opt-in to new HTML5 browser validations (for things like email and url inputs) by setting
|
88
|
+
# this to true. Doing so will add a `novalidate` attribute to the `<form>` tag.
|
89
|
+
# See http://diveintohtml5.org/forms.html#validation for more info.
|
90
|
+
# Formtastic::FormBuilder.perform_browser_validations = true
|
91
|
+
|
92
|
+
# By creating custom input class finder, you can change how input classes are looked up.
|
93
|
+
# For example you can make it to search for TextInputFilter instead of TextInput.
|
94
|
+
# See # TODO: add link # for more information
|
95
|
+
# NOTE: this behavior will be default from Formtastic 4.0
|
96
|
+
Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder
|
97
|
+
|
98
|
+
# Define custom namespaces in which to look up your Input classes. Default is
|
99
|
+
# to look up in the global scope and in Formtastic::Inputs.
|
100
|
+
# Formtastic::FormBuilder.input_namespaces = [ ::Object, ::MyInputsModule, ::Formtastic::Inputs ]
|
101
|
+
|
102
|
+
# By creating custom action class finder, you can change how action classes are looked up.
|
103
|
+
# For example you can make it to search for MyButtonAction instead of ButtonAction.
|
104
|
+
# See # TODO: add link # for more information
|
105
|
+
# NOTE: this behavior will be default from Formtastic 4.0
|
106
|
+
Formtastic::FormBuilder.action_class_finder = Formtastic::ActionClassFinder
|
107
|
+
|
108
|
+
# Define custom namespaces in which to look up your Action classes. Default is
|
109
|
+
# to look up in the global scope and in Formtastic::Actions.
|
110
|
+
# Formtastic::FormBuilder.action_namespaces = [ ::Object, ::MyActionsModule, ::Formtastic::Actions ]
|