talonframework / talon

An app builder framework for Phoenix
MIT License
164 stars 9 forks source link

Strip app namespace if provided in talon.gen.resource #26

Open smpallen99 opened 7 years ago

smpallen99 commented 7 years ago

We should check if the user provided top level app namespace and remove it for them.

warlokkz commented 7 years ago

I wanted to help contribute to this and for clarification here is an example:

If a user has this configuration,

use Mix.Config

config :talon_blog_demo, :talon,
  module: TalonBlogDemo,
  themes: ["admin-lte"],
  concerns: [TalonBlogDemo.Admin],

  web_namespace: Web

and they attempt to run this command:

mix talon.gen.resource TalonBlogDemo.User

the Mix task should recognize the top level app namespace TalonBlogDemo and run the equivalent to:

mix talon.gen.resource User

instead?