ashes 0.0.3

A code generation tool for the phoenix web framework

Platform: Hex

Language: Elixir

License: MIT

Repository: https://github.com/nickgartmann/ashes

View on registry: https://hex.pm/packages/ashes/

Documentation: http://hexdocs.pm/ashes/0.0.3


Ashes

A code generation tool for the Phoenix web framework.

defp deps do
 [{:ashes, ">= 0.0.3"}]
end

Controllers

Generates a controller with a given name, will also generate a view and create a folder for you to put related .eex templates in. Don't forget to add the controller in routes.ex

$ mix ashes.generate controller <controllername>
# web/router.ex
defmodule MyApp.Router do
 ...
 scope "/", MyApp do
 resources "/my", MyController
 end
end

Will give you the following functions by default:

  • index
  • edit
  • new
  • show
  • create
  • update
  • delete

Options

  • --skip-form - removes the edit and new functions from the controller (likely used for APIs)
  • --skip-view - doesn't create a view module
  • --skip-template- doesn't create a folder for templates

Channels

Generates a channel with the given name. Don't forget to add the channel to your router

$ mix ashes.generate channel <channelname> [events]
# routes.ex
defmodule MyApp.Router do
 ...
 socket "/ws", MyApp do
 channel "my:*", MyChannel
 end
end

Will give you the following functions by default:

  • join(_topic, message, socket)
  • leave(_reason, socket)

If you provide events in the generate command, they will be added to the channel as

def handle_in("eventname", message, socket) do
 {:ok, socket}
end

Models

Generates an Ecto model with the given name and schema. Requires ecto!

$ mix ashes.generate model <modelname> [schema entries]

Schema entries should be of the form name:type with types being defined by ecto.

Options

  • --timestamps - adds ecto timestamps to your schema.

Migrations

Assumes a valid repo module name of MyApp.Repo

Generates an Ecto migration with the given name. Requires ecto

$ mix ashes.generate migration <migrationname>
веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей

GitHub Repository

nickgartmann/ashes nickgartmann/ashes

A code generation tool for the Phoenix web framework

Language: Elixir

Created: January 12, 2015 02:21

Last updated: March 07, 2015 21:32

Last pushed: January 28, 2015 17:08

Size: 295 KB

Stars: 42

Forks: 7

Watchers: 4

Open issues: 2

Top Contributors

Nick Gartmann Jason S. Gary Rennie Chris McCord Miloš Mošić X4lldux

Releases

  • 0.0.3 - January 23, 2015 19:16
  • 0.0.2 - January 12, 2015 20:17
  • 0.0.1 - January 12, 2015 03:39

Related Projects

exrecaptcha 0.0.3
Simple ReCaptcha display/verify code for Elixir applications. Designed to be used with a CMS such...
Hex - Elixir - WTFPL - Updated 3 months ago - 2 stars
finch 0.0.3
Resource layer for Phoenix and Ecto projects for auto-generated RESTful CRUD APIs.
Hex - Elixir - MIT - Updated 5 months ago - 1 stars
phoenix_haml 0.1.0
Phoenix Template Engine for Haml
Hex - Elixir - MIT - Updated 4 months ago - 8 stars
plug_session_memcached 0.2.3
This is a very simple memcached session store for Elixir's plug. I use it in conjunction with the...
Hex - Elixir - MIT - Published 3 months ago - 1 stars
crudex 0.0.2
A glue keeping Phoenix and Ecto together
Hex - Elixir - ISC - Updated 2 months ago - 5 stars
веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей