Skip to content

Generators #24

@johannesschobel

Description

@johannesschobel

Dear @a-chacon ,

following up the discussion in #22 and #23 and #7 , i decided to move the generator stuff into a dedicated issue, in order to enhance transparency and have everything in one place.

I guess, i would like to have it like this:

  1. have everything like you have right now (bundle add, run the migrations, create initializer).
  2. i would rename the rails g rails_url_shortener command to rails_url_shortener:install to fit the other command (but that is just a minor tweak and not really required)

If a user is happy with this default setup, he can use the lib as intended and nothing changes here.

However, if i would like to customize the models, i would run

  1. rails g rails_url_shortener:models - which will basically copy the default models into app/models/ (or whatever subfolder), so i can customize it. I then would have to manually write an additional migration file, in case i add fields

  2. rails g rails_url_shortener:controllers - could copy the controllers into app/controllers/ (or whatever subfolder), so it can be customized (i.e., add a password protection, ...)

The idea would be, to add the gem and leave it there as a regular "production" dependency. Like - for example - devise, most functionality is within the gem, however, i can adjust it, where i need.

Unfortunately, i have never tried working on a rails generator, therefore, i don't think, i can handle that for now (in a proper way that a PR would get accepted ;) ). For now, i am just writing down my ideas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions