subsite generator default options suboptimal
Reported by Bryan Larsen | May 16th, 2011 @ 05:43 PM | in Hobo 1.3 (Rails 3)
In Hobo 1.0, we force the user to explicitly set either the --no-front-site option or the --make-front-site option. In 1.3, the --no-front-site is the default.
I believe this is a mistake, that the --make-front-site is generally the right option for users. Without it, there is duplicate code between application.dryml and admin_site.dryml, triggering bug #942 and/or just making things slower.
I can understand why you wouldn't want to make --make-front-site the default since it's more potentially destructive of the user's application, which is why I like the 1.0 choice of forcing the user to choose. This makes sure the user makes a clear decision rather than choosing the default.
Here's the USAGE I'm going to add to the admin_site and the subsite generators:
Description:
Creates a subsite, a namespaced section of your application.
Controllers for the subsite are created in
app/controllers/<subsite_name>/ and views are also in their own
subdirectory. This allows you to have two different controllers
and two different sets of views for the same model.
The subsite will use app/views/taglibs/<subsite_name>_site.dryml
as well as app/views/taglibs/application.dryml. This allows you
to easily set different themes and choose different CSS files for
the subsite. The remaining views of your application that are not
under a subsite load both application.dryml and front_site.dryml.
It is thus recommended that you ensure that
<subsite_name>_site.dryml and application.dryml do not repeat
code, such as the inclusion of rapid or the setting of the theme.
One easy way of ensuring this is to use the --make-front-site
option.
The difference between hobo:admin_site and hobo:subsite is that
hobo:admin_site limits the subsite to use by administrators only.
Comments and changes to this ticket
-
Domizio Demichelis May 16th, 2011 @ 06:17 PM
Good point, Bryan.
We have also to add the question to the wizard.
I would just change the sentence about the theme, because it might be interpreted as a hobo-theme, which is still application-wide, not subsite-wide (IIRC).
-
Domizio Demichelis May 19th, 2011 @ 02:13 AM
- State changed from new to resolved
(from [def33d142bf1ead4b58428d2490116a01c488d4f]) refactory of admin_subsite generator [#950 state:resolved]
- --make-front-site is now required (Thor patched)
- the setup_wizard generator now has 2 new options: --add-admin-subsite and --make-front-site (default true)
- the setup_wizard generator now will ask for both options, so adding an admin_subsite will be possible even with a non-invite_only site https://github.com/tablatom/hobo/commit/def33d142bf1ead4b58428d2490...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Referenced by
- 950 subsite generator default options suboptimal (from [def33d142bf1ead4b58428d2490116a01c488d4f]) refacto...