Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update generator help [#510 state:resolved] [#505 state:resolved]
- Loading branch information
1 parent
0fe8974
commit 528f6a1
Showing
9 changed files
with
128 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Description: | ||
|
||
Adds support for the basic Hobo & DRYML system, not including | ||
Rapid. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Description: | ||
|
||
Creates a subsite, a namespaced section of your application. | ||
|
||
The subsite will use app/views/taglibs/<subsite_name>_site.dryml | ||
instead of app/views/taglibs/appplication.dryml. This allows you | ||
to easily set different themes and choose different CSS files for | ||
the subsite. | ||
|
||
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 difference between hobo_admin_site and hobo_subsite is that | ||
hobo_admin_site limits the subsite to use by administrators only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Description: | ||
The model generator creates stubs for a new model, corresponding | ||
controller and it's views. | ||
|
||
The generator takes a model name as its argument. The model name | ||
may be given in CamelCase or under_score and should not be | ||
suffixed with anything. | ||
|
||
As additional parameters, the generator will take attribute pairs | ||
described by name and type. These attributes will be used to | ||
prepopulate the migration to create the table for the model and | ||
give you a set of predefined fixture. You don't have to think up | ||
all attributes up front, but it's a good idea of adding just the | ||
baseline of what's needed to start really working with the | ||
resource. | ||
|
||
The generator creates a model class in app/models, a test suite in | ||
test/unit and test fixtures in test/fixtures/singular_name.yml. | ||
The generator creates a controller class in app/controllers with | ||
view templates in app/views/controller_name, a helper class in | ||
app/helpers, and a functional test suite in test/functional. | ||
|
||
Examples: | ||
./script/generate hobo_model_resource account | ||
|
||
This will create an Account model: | ||
Model: app/models/account.rb | ||
Controller: app/controllers/accounts_controller.rb | ||
Helper: app/helpers/accounts_helper.rb | ||
Views: app/views/accounts | ||
ViewHints: app/viewhints/account_hints.rb | ||
Test: test/unit/account_test.rb | ||
Test: test/functions/accounts_controller_test.rb | ||
Fixtures: test/fixtures/accounts.yml | ||
|
||
./script/generate hobo_model_resource post title:string created_on:date body:text published:boolean | ||
|
||
Creates post model, controller & views with predefined attributes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Description: | ||
|
||
Adds support for Rapid to your application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Description: | ||
|
||
Creates a subsite, a namespaced section of your application. | ||
|
||
The subsite will use app/views/taglibs/<subsite_name>_site.dryml | ||
instead of app/views/taglibs/appplication.dryml. This allows you | ||
to easily set different themes and choose different CSS files for | ||
the subsite. | ||
|
||
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 difference between hobo_admin_site and hobo_subsite is that | ||
hobo_admin_site limits the subsite to use by administrators only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Description: | ||
|
||
This generator compares your existing schema against the | ||
schema declared inside your fields declarations in your | ||
models. | ||
|
||
If the generator finds differences, it will display the | ||
migration it has created, and ask you if you wish to | ||
[g]enerate migration, generate and [m]igrate now or [c]ancel? | ||
Enter "g" to just generate the migration but do not run it. | ||
Enter "m" to generate the migration and run it, or press "c" | ||
to do nothing. | ||
|
||
The generator will then prompt you for the generator name, | ||
supplying a numbered default name. | ||
|
||
The generator is conservative and will prompt you to resolve | ||
any ambiguities. | ||
|
||
Examples: | ||
|
||
$ ./script/generate hobo_migration | ||
|
||
---------- Up Migration ---------- | ||
create_table :foos do |t| | ||
t.datetime :created_at | ||
t.datetime :updated_at | ||
end | ||
---------------------------------- | ||
|
||
---------- Down Migration -------- | ||
drop_table :foos | ||
---------------------------------- | ||
What now: [g]enerate migration, generate and [m]igrate now or [c]ancel? m | ||
|
||
Migration filename: | ||
(you can type spaces instead of '_' -- every little helps) | ||
Filename [hobo_migration_2]: create_foo | ||
exists db/migrate | ||
create db/migrate/20091023183838_create_foo.rb | ||
(in /work/foo) | ||
== CreateFoo: migrating ====================================================== | ||
-- create_table(:yos) | ||
-> 0.0856s | ||
== CreateFoo: migrated (0.0858s) ============================================= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters