Open ericfranz opened 7 years ago
Devise contains views within the gem, but also includes a feature to copy those views into the app for modification. We should assume that our default views will be unsatisfactory for a developer and provide the option to write them into the file, if we go this route.
If config.rb doesn't have a root route specified, is it possible to have a default one specified by an engine?
I haven't found a way to do this via an engine. I looked into how Devise does it and they modify an app's config/routes.rb
file to point to the Devise controller when using the rails generate devise MODEL
command.
Just a guess. A rails engine that isn't namespace isolated should be able specify a root
route in the engine's config/routes.rb
file and perhaps this will become the default if no root route is specified in the application's config/routes.rb
. Not sure.
Actually I don't think my suggestion would work. While engines that are not isolated share models, controllers, and helpers with the application itself, there is no mention of routes defined in an engine working this way: http://edgeapi.rubyonrails.org/classes/Rails/Engine.html
Can an engine detect if there is a root route set, and if not, set it during initialization?
Define a root in rails engine to specify towards the end so the user routes.rb specifies it, that is used, otherwise this is used.
We removed generating the "static pages" for About that would display initially via the Rails application template. The result is a newly created app, running the template, results in this page once gems are installed:
These directions are incorrect/incomplete for our environment.
Instead of generating static pages, we can just have the rails application template have root point to a controller/view that is embedded in ood_appkit.
Other options/thoughts:
Instead of doing this, if we took Jeremy's suggestion with a default table for workflows etc., we could initialize with 2 tables (using STI) for both jobs and workflows and provide default index etc. pages in ood_appkit that use this. Similar to how devise works, the views would be in ood_appkit and the user could just generate and create models (without any generators required).
Then the starting page could be the index page instead (the start of a working application).
This would make a "pre-built" app much more appealing, because to build a simple app, theoretically, you would just need to copy, run rake db:migrate or rake db:setup, and then:
This is getting closer to a version of BatchSim, though.
┆Issue is synchronized with this Asana task by Unito