Posts mit dem Label generate werden angezeigt. Alle Posts anzeigen
Posts mit dem Label generate werden angezeigt. Alle Posts anzeigen

Freitag, 20. Juni 2008

Rake Scaffold

ruby script/generate scaffold SingularModelName data_field_name:type -c

The -c adds the file generated to the svn repository.

Dienstag, 20. Mai 2008

Using Rails with SVN

1. mkdir getready
2. cd getready
3. rails projectname
4. mv projectname trunk
5. mkdir tags
6. mkdir branches
7. cd trunk/config
8. mv database.yml database_example.yml
9. cd ..
10. rm -r tmp/*
11. rm -r log/*
12. cd ..
13 svn import . http://path_to_repository -m "initial import"
14. ...now you can get rid of getready folder - we dont need it anymore
15. svn co http://path_to_project_trunk projectname
16. cd projectname
17. cp config/database_example.yml database.yml
18. add passwords to the database entries
19. svn propset svn:ignore database.yml config/
20. svn propset svn:ignore "*" tmp/
21. svn propset svn:ignore "*" logs/
22. svn commit -m "ignoring files"
23. svn copy http://from_repository_trunk http://repository_tag_path_REL_XXX -m "initial snapshot release"

############################
# just a few things to remember
############################

1. when generating a model, controller or scaffold use the following

useraccount>ruby script/generate scaffold angry farmer bales_of_hey:integer name -c

DON'T FORGET THE -c AT THE END!!!

2. When installing a plugin

ruby script/install name_of_plugin -x

also a great railscast on the basics.

Working

To see the status of the files in the repository use:

useraccount> svn status

To commit changes to the files

useraccount> svn commit -m "somthing about what you are commiting"

To add files that you have changes (they have a ? next to them when you see the status).

useraccount> svn add directory_and_name_of_file

to ignore files

useraccount> svn propset svn:ignore *.pyc dirname
or
useraccount> svn propset svn:ignore dirname