Danny Oosthoek
Danny Oosthoek

Reputation: 13

Altering the current outcome of the model of a generated scaffold

I aim to make some turbo additions to the current scaffold generator. For that i need the plural_model_name in the model. I am looking for a way to alter the output model, generated by the rails g scaffold command.

class <%= singular_model_name %> < ApplicationRecord
  broadcasts to: <%= plural_model_name %>
end

Can anyone give me a nudge in the right direction?, I would also be very thankful if some instructions can be given as to in which folder in /lib/i am supposed to place the monkey-patched version.

I have been going through nearly all generators here but i cannot seem to get a grasp of where the model is taken care of.

Contrary to the model i have successfully been able to alter the view templates, view generator, and controller template and ScaffoldControllerGenerator for the scaffold generator.

Upvotes: 1

Views: 29

Answers (1)

Related Questions