Issues generating models for plugin

AI-generated summary

SilK is having issues generating models for a custom Discourse plugin using the discourse-plugin-skeleton. When running rails g model Example, they receive an unexpected usage message. Despite trying alternative approaches, they are unable to successfully generate the model. Falco suggested that Rails generators may not be compatible with Discourse plugins, as they are not standalone Rails apps, and instead recommends creating plugin files manually.

Hi there,

Sorry if this isn’t categorized properly - it’s my first time here.

I’m having issues generating models for my custom plugin. I’m working off of the discourse-plugin-skeleton. This is what occurs when I attempt to generate a model:

$ rails g model Example
Usage:
  rails new APP_PATH [options]

Options:
...

I’ve tried creating a new rails new project via the command mentioned in the output above, but it adds a lot of clutter which I do not see in projects such as discourse-data-explorer (and I’m not sure if it will have adverse effects).

My current setup is I have a local development install of Discourse, and in the plugins directory of that Discourse install I have a symbolic link to my plugin. I’ve tested this same setup with the bare discourse-plugin-skeleton and I get the same issue with not being able to generate using rails.

Any input on how I can get this working is much appreciated. :slight_smile:

Bumping this - hopefully someone has some input.

Not sure any of the Rails generators are expected to work in Discourse plugins, as plugins by themselves are not Rails apps. AFAIK we create the plugin files manually as needed.