All Projects → AndyObtiva → Ultra_light_wizard

AndyObtiva / Ultra_light_wizard

Licence: mit
No time to manage a wizard state machine, session variables, or complicated controllers? Use ultra light wizard!! A RESTful session-less validation-friendly simple multi-step form approach in Rails.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Ultra light wizard

Generate
A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
Stars: ✭ 238 (+580%)
Mutual labels:  rails, generator, scaffold
Generator
Rails-inspired generator system that provides scaffolding for your apps
Stars: ✭ 1,000 (+2757.14%)
Mutual labels:  generator, scaffold
Generate Gh Repo
Generate generator to create a new repository on GitHub.
Stars: ✭ 11 (-68.57%)
Mutual labels:  generator, scaffold
Generator Standard Readme
Scaffold out a Standard Readme
Stars: ✭ 150 (+328.57%)
Mutual labels:  generator, scaffold
Go On Rails
🚄 Use Rails to Develop or Generate a Golang Application.
Stars: ✭ 275 (+685.71%)
Mutual labels:  rails, generator
Structor
Structor - React UI Builder [DEPRECATED]
Stars: ✭ 5,522 (+15677.14%)
Mutual labels:  generator, scaffold
Angular Librarian
An Angular 2+ scaffolding setup for creating libraries
Stars: ✭ 92 (+162.86%)
Mutual labels:  generator, scaffold
Assemble
Community
Stars: ✭ 3,995 (+11314.29%)
Mutual labels:  generator, scaffold
Project Name
Get the name of a project from package.json, git config, or basename of the current working directory.
Stars: ✭ 8 (-77.14%)
Mutual labels:  generator, scaffold
Larawiz
Larawiz is a easy project scaffolder for Laravel
Stars: ✭ 28 (-20%)
Mutual labels:  generator, scaffold
Ansible Schema Generator
Generate JSON schema for language servers from Ansible module documentation
Stars: ✭ 30 (-14.29%)
Mutual labels:  generator
Activeadmin froala editor
Froala WYSIWYG editor for ActiveAdmin
Stars: ✭ 30 (-14.29%)
Mutual labels:  rails
Renew
Mix task to create mix projects that builds into Docker containers.
Stars: ✭ 33 (-5.71%)
Mutual labels:  generator
Ununiga
[은는이가] 한글 조사(助詞) 대응 I18n engine extension
Stars: ✭ 34 (-2.86%)
Mutual labels:  rails
Sao Nm
Scaffold out a node module.
Stars: ✭ 30 (-14.29%)
Mutual labels:  generator
Instagram Scheduler
📷 Beautiful way to get shadowbanned on Instagram by ⏰ scheduling your 🌁 photos.
Stars: ✭ 33 (-5.71%)
Mutual labels:  rails
Git Changelog
Automatic Changelog generator using Jinja2 templates.
Stars: ✭ 30 (-14.29%)
Mutual labels:  generator
Catalyst
Typescript NodeJS Microservices Boilerplate with Generator CLI - Moleculer, GraphQL, REST, OAuth2, Jaeger, Grafana, Prometheus, Ory Hydra, Ory Keto w/ Access Control middleware, Moleculer-DB GraphQL mixin, Pug, Redis, sibling client repo (login, persistance layer, react-native-web, ios, android)
Stars: ✭ 30 (-14.29%)
Mutual labels:  generator
Versionist
A plugin for versioning Rails based RESTful APIs.
Stars: ✭ 950 (+2614.29%)
Mutual labels:  rails
Activeadmin blaze theme
ActiveAdmin theme based on Blaze CSS toolkit
Stars: ✭ 35 (+0%)
Mutual labels:  rails

Ultra Light Wizard v0.1.4 (beta)

No time to manage a wizard state machine, session variables, or complicated controllers? Use Ultra Light Wizard!! A RESTful session-less validation-friendly simple multi-step form architectural pattern in Rails.

Ultra Light Wizard Image

This RailsConf 2014 talk video explains it all: https://www.youtube.com/watch?v=muyfoiKHMMA

Principles

  • REST: wizard (multi-step form) steps are represented as REST nested resources under the model resource being built
  • MVC: respects MVC separation of concerns
  • OO: honors OO principles of low coupling and high cohesion
  • Design Patterns: wizard (multi-step form) is simply a model Builder
  • DDD: supports domain concepts directly with customizable vocabulary
  • Non-Functional Requirements:
    • Productivity: minimum effort for adding wizards (multi-step forms) and wizard steps
    • Maintainability: minimum code to maintain while adhering to other principles
    • Performance: stateless design means scalability
    • Security: stateless design is compatible with Rails security measures

Details

To learn more about the Ultra Light Wizard architectural pattern philosophy and function, please read this blog post: Ultra Light & Maintainable Wizard in Rails

Note: Since Ultra Light Wizard is an architectural pattern that can be applied whether using this library or not, it is more important to understand it well first through watching the video and reading the article provided above. Afterward, you may use the library to get started quickly via Rails scaffolding for new project models or otherwise avoid by applying pattern manually for existing project models.

Ultra Light Wizard Step Breadcrumb

Instructions

Add the following to your Rails project Gemfile:

gem 'ultra_light_wizard', '~> 0.1.4'

Run the command:

bundle

Then, use the following command in place of the Rails scaffold generator, and it will scaffold both standard resource components and wizard-related components:

rails generate ultra_light_wizard:scaffold (resource) steps:(step1),(step2),(step3),... attributes:(attribute1:db_type1),(attribute2:db_type2),...

This will generate wizard (multi-step form) step routes, controller, models, and views

Example:

rails generate ultra_light_wizard:scaffold Project steps:basic_info,project_detail,file_uploads,preview attributes:name:string,description:text,start_date:date,delivery_date:date

Output:

generate  scaffold
  invoke  active_record
  create    db/migrate/20160201025849_create_projects.rb
  create    app/models/project.rb
  invoke    test_unit
  create      test/models/project_test.rb
  create      test/fixtures/projects.yml
  invoke  resource_route
   route    resources :projects
  invoke  scaffold_controller
  create    app/controllers/projects_controller.rb
  invoke    erb
  create      app/views/projects
  create      app/views/projects/index.html.erb
  create      app/views/projects/edit.html.erb
  create      app/views/projects/show.html.erb
  create      app/views/projects/new.html.erb
  create      app/views/projects/_form.html.erb
  invoke    test_unit
  create      test/controllers/projects_controller_test.rb
  invoke    helper
  create      app/helpers/projects_helper.rb
  invoke      test_unit
  invoke    jbuilder
  create      app/views/projects/index.json.jbuilder
  create      app/views/projects/show.json.jbuilder
  invoke  assets
  invoke    coffee
  create      app/assets/javascripts/projects.coffee
  invoke    scss
  create      app/assets/stylesheets/projects.scss
  invoke  scss
identical    app/assets/stylesheets/scaffolds.scss
    gsub  app/controllers/projects_controller.rb
    gsub  app/controllers/projects_controller.rb
  insert  app/controllers/projects_controller.rb
    gsub  app/views/projects/index.html.erb
  create  app/controllers/project_steps_controller.rb
  create  app/helpers/project_steps_helper.rb
  create  app/views/project_steps/_step_navigation.html.erb
  create  app/models/project/name.rb
  create  app/views/project_steps/name.html.erb
  create  app/models/project/description.rb
  create  app/views/project_steps/description.html.erb
  create  app/models/project/start_date.rb
  create  app/views/project_steps/start_date.html.erb
  create  app/models/project/delivery_date.rb
  create  app/views/project_steps/delivery_date.html.erb
  create  app/models/project/preview.rb
  create  app/views/project_steps/preview.html.erb
   route  resources :projects, only: [:create, :show] do
resources :project_steps, only: [:edit, :update]
end

Once the files are generated, you can proceed to place your own code customizations in the wizard step models and views.

To kick-off wizard, simply trigger the main model controller create action, and it will transition to the wizard step first step edit action.

For example, the following will kick-off the project wizard by creating a project and automatically redirecting to first step:

<%= link_to 'New Project', projects_path, method: :post %>

If you'd like to customize the term "step", you can add a step_alias:(alias) option as in the following:

Example:

rails generate ultra_light_wizard:scaffold Project step_alias:part steps:basic_info,project_detail,file_uploads,preview attributes:name:string,description:text,start_date:date,delivery_date:date

Output:

generate  scaffold
  invoke  active_record
  create    db/migrate/20160201025849_create_projects.rb
  create    app/models/project.rb
  invoke    test_unit
  create      test/models/project_test.rb
  create      test/fixtures/projects.yml
  invoke  resource_route
   route    resources :projects
  invoke  scaffold_controller
  create    app/controllers/projects_controller.rb
  invoke    erb
  create      app/views/projects
  create      app/views/projects/index.html.erb
  create      app/views/projects/edit.html.erb
  create      app/views/projects/show.html.erb
  create      app/views/projects/new.html.erb
  create      app/views/projects/_form.html.erb
  invoke    test_unit
  create      test/controllers/projects_controller_test.rb
  invoke    helper
  create      app/helpers/projects_helper.rb
  invoke      test_unit
  invoke    jbuilder
  create      app/views/projects/index.json.jbuilder
  create      app/views/projects/show.json.jbuilder
  invoke  assets
  invoke    coffee
  create      app/assets/javascripts/projects.coffee
  invoke    scss
  create      app/assets/stylesheets/projects.scss
  invoke  scss
identical    app/assets/stylesheets/scaffolds.scss
    gsub  app/controllers/projects_controller.rb
    gsub  app/controllers/projects_controller.rb
  insert  app/controllers/projects_controller.rb
    gsub  app/views/projects/index.html.erb
  create  app/controllers/project_parts_controller.rb
  create  app/helpers/project_parts_helper.rb
  create  app/views/project_parts/_part_navigation.html.erb
  create  app/models/project/name.rb
  create  app/views/project_parts/name.html.erb
  create  app/models/project/description.rb
  create  app/views/project_parts/description.html.erb
  create  app/models/project/start_date.rb
  create  app/views/project_parts/start_date.html.erb
  create  app/models/project/delivery_date.rb
  create  app/views/project_parts/delivery_date.html.erb
  create  app/models/project/preview.rb
  create  app/views/project_parts/preview.html.erb
   route  resources :projects, only: [:create, :show] do
resources :project_parts, only: [:edit, :update]
end

Features

  • Ultra Light Wizard scaffold generator
    • Scaffolding of main model controller/views/migration
    • Routes
    • Controller steps
    • Model parts
    • View parts
    • View navigation
    • Helper for ultra light wizard support
    • Route helper methods
    • Wizard kick-off helper/view
    • Forms
    • Support for attributes
    • Form fields
    • Custom name conventions
    • Wizard step breadcrumb with easily stylable semantic markup
    • [UPCOMING] JS Ajax support

Enhancements

If you are interested in having enhancements implemented, please report via a GitHub issue, describing the problem, providing use case examples, and suggesting solutions to implement.

History

v0.1.4 Step breadcrumb, having easily customizable semantic markup v0.1.3 test coverage with feature specs / fixed issue 4 Generate routes in the right order v0.1.2 ensure resource creation redirects to first step / include step helper in resource controller v0.1.1 includes permitted params and edit/update actions v0.1.0 initial implementation

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].