live_scaffolding

Live Scaffolding dep for generate view controllers, live views and scaffold crud models


License
BSD-1-Clause

Documentation

Live Manager

Apprentice's Journey Open Source

Don't waste your time!

This project is for help you to generate the phoenix controllers and also live views too!

** This project is the upgrade for previous version of scaffolding **

This was born for personal usages.

Installation

def deps do
  [
    {:scaffolding, git: "git://github.com/apprenticesjourney/live_scaffolding.git", only: [:dev]}
  ]
end

TODO I have troubles using this way: {:scaffolding, "~> 0.1.0", only: [:dev]}, I don't know why the priv directory can't be downloaded into the scaffolding dep. Use the suggestion instead.

How to use

Create a phoenix controller

mix create_controller page1

This will generate the follow output:

 :: Scaffolding Generator Done! ::

 Please update your router.ex file adding the follow line:

 >>> get "/page1", Page1Controller, :index

This command will create many files:

  1. The phoenix controller: lib/your_app_web/controllers/page1_controller.ex
  2. The eex template folder with index file: lib/your_app_web/templates/page1/
  3. The view for your controller: lib/your_app_web/views/page1_view.ex

You will have to update you router.ex file for use your controller generated.

Create a Phoenix Live View

You need your Live View setup for implement this.

mix create_live_view page1

This will generate the follow output:

 :: Scaffolding Generator Done! ::

 Please update your router.ex file adding the follow line:

 >>> live "/page1", Page1Live

This command will create many files:

  1. The live view: lib/your_app_web/live/page1_live.ex
  2. The leex template: lib/your_app_web/templates/page1/
  3. The view: lib/your_app_web/views/page1_view.ex

You will have to update you router.ex file for use your controller generated.