Rails plugin generator

Hey,

I generated a hello world plugin with this generator, added a bunch of Ruby “write to a file” statements and watched the Rails lifecycle, found and the Rails controllers were not working as expected (they would not log, indicating they were were being ignored).

After debugging, I got this to work as expected by moving the Rails controllers up a directory.

In addition, also added a Javascript/Ember controller and template for the main index page, added some HTML and CSS to all the templates and added some JS code to read the cookies and highlight the templates.

For example, after a few changes to the plugin generated by the rails plugin generator:

http://localhost:3000/hello-world/

For full details and screenshots, please see:

In closing, I would like to thank @j.jaffeux for this rails plugin generator. I had a lot of fun debugging the Rails controllers and enjoyed modifying it to provide more code to inspect both the Rails lifecycle and the JS templates/controllers.

I hope my changes help anyone else who, like me, is still learning the basics of Discourse in plugin dev in their spare time and would like to use the rails plugin generator.

See also:

Currently, I am really having fun debugging and fixing broken plugins as part of the Rails and Discourse plugin dev learning process :slight_smile:

5 Likes