Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow users to override admin templates on a file by file basis #1226
This change lets users override single templates by including them in a
For example, if I want to include my company logo in every edit page I can add a file like so:
The admin generator will use my custom thor template for every edit page and fall back to the gem for everything else.
My use case for this has been when I'd like the admin generator to include image uploads by for models with a field name containing '_img' or a position widget for a field called 'position'. Being able to tweak the admin page generator to do this speeds up development when you have lots of models.
If the folder isn't there it doesn't complain and the generator works as standard. I've added tests for both the admin app and page generator.
What do people think?
I think you have a valid point here, thanks for submitting the patch.
I'm just not sure about the implementation and if the main gem is the right place for it (perhaps it goes into plugins or something). Let me have a look at it in more depth.