How can i cancel the effect of a command-generate controller in my app

Hellowhat command can i sue to get rid of the effect of the  below
command

ruby
script/generate scaffold \ user name:string hashed_password:string
salt:string

Regards and Respects,

Kindness in thought leads to wisdom.
Kindness in speech leads to eloquence.
Kindness in action leads to love.

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Sat, Dec 26, 2009 at 3:55 PM, Oluwayomi O.
[email protected]wrote:

Oluwayomi, you can do the following:

ruby script/generate user name:string hash_password:string salt:string

Note: The above code will generate a model called User.

Good luck,

-Conrad

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Sat, Dec 26, 2009 at 4:31 PM, Conrad T. [email protected]
wrote:

Oluwayomi, you can do the following:

ruby script/generate user name:string hash_password:string salt:string

ruby script/generate model user name:string hash_password:string
salt:string

Note: The above code will generate a model called User.

Good luck,

-Conrad

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Are you asking about how to reverse this? There is a destroy script
available with the rails install:

yvaine:reverseblade rilindo$ ruby script/destroy
Usage: script/destroy generator [options] [args]
Rails Info:
-v, --version Show the Rails version number and
quit.
-h, --help Show this help message and quit.
General Options:
-p, --pretend Run but do not make any changes.
-f, --force Overwrite files that already exist.
-s, --skip Skip files that already exist.
-q, --quiet Suppress normal output.
-t, --backtrace Debugging: show backtrace on
errors.
-c, --svn Modify files with subversion.
(Note: svn must be in path)
-g, --git Modify files with git. (Note: git
must be in path)

Installed Generators
Builtin: controller, helper, integration_test, mailer, metal,
migration, model, observer, performance_test, plugin, resource,
scaffold, session_migration

script/generate command. For instance, ‘script/destroy migration
CreatePost’
will delete the appropriate XXX_create_post.rb migration file in
db/migrate,
while ‘script/destroy scaffold Post’ will delete the posts controller
and
views, post model and migration, all associated tests, and the
map.resources
:posts line in config/routes.rb.

For instructions on finding new generators, run script/generate.
yvaine:reverseblade rilindo$

Same options as generate, except it cleans out your generated files.

On Dec 26, 2009, at 6:55 PM, Oluwayomi O. wrote:

Kindness in thought leads to wisdom.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

what do i edit in route.rb? thanks

Regards and Respects,

Kindness in thought leads to wisdom.
Kindness in speech leads to eloquence.
Kindness in action leads to love.

— On Sat, 12/26/09, Hassan S. [email protected]
wrote:

From: Hassan S. [email protected]
Subject: Re: [Rails] How can i cancel the effect of a command-generate
controller in my app
To: [email protected]
Date: Saturday, December 26, 2009, 5:01 PM

On Sat, Dec 26, 2009 at 3:55 PM, Oluwayomi O.
[email protected] wrote:

what command can i sue to get rid of the effect of the  below command

ruby script/generate scaffold \ user name:string hashed_password:string salt:string

Look at the list of files that were generated and remove them :slight_smile:
(You’ll also need to edit routes.rb)

And for the future – if you were using a versioning system like git,
you could create a branch when you were adding a model, and if
it didn’t suit you afterwards, you could just delete the branch. FWIW!


Hassan S. ------------------------ [email protected]
twitter: @hassan

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Sat, Dec 26, 2009 at 3:55 PM, Oluwayomi O.
[email protected] wrote:

what command can i sue to get rid of the effect of the below command

ruby script/generate scaffold \ user name:string hashed_password:string salt:string

Look at the list of files that were generated and remove them :slight_smile:
(You’ll also need to edit routes.rb)

And for the future – if you were using a versioning system like git,
you could create a branch when you were adding a model, and if
it didn’t suit you afterwards, you could just delete the branch. FWIW!


Hassan S. ------------------------ [email protected]
twitter: @hassan

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Oluwayomi O. wrote:

what do i edit in route.rb? thanks

Whatever your version control system says was changed.

If you’re not using version control, download Git and start today.
There is no excuse for working without version control.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Sun, Dec 27, 2009 at 6:36 AM, Oluwayomi O.
[email protected] wrote:

what do i edit in route.rb? thanks

Well, I totally forgot about script/destroy which Rilindo mentioned, so
that’s certainly an easier route.

However, if you need/want to do it manually, just look for a reference
to the model you created; it’ll be pretty obvious.

And really, use git for revision control and get in the habit of
frequent
commits; it’ll be such a time-saver when you can just

prompt$ git diff config/routes.rb

to find the changes…

FWIW,

Hassan S. ------------------------ [email protected]
twitter: @hassan

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

thanks

Regards and Respects,

Kindness in thought leads to wisdom.
Kindness in speech leads to eloquence.
Kindness in action leads to love.

— On Sun, 12/27/09, Hassan S. [email protected]
wrote:

From: Hassan S. [email protected]
Subject: Re: [Rails] How can i cancel the effect of a command-generate
controller in my app
To: [email protected]
Date: Sunday, December 27, 2009, 8:13 AM

On Sun, Dec 27, 2009 at 6:36 AM, Oluwayomi O.
[email protected] wrote:

what do i edit in route.rb? thanks

Well, I totally forgot about script/destroy which Rilindo mentioned, so
that’s certainly an easier route.

However, if you need/want to do it manually, just look for a reference
to the model you created; it’ll be pretty obvious.

And really, use git for revision control and get in the habit of
frequent
commits; it’ll be such a time-saver when you can just

 prompt$ git diff config/routes.rb

to find the changes…

FWIW,

Hassan S. ------------------------ [email protected]
twitter: @hassan

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Sun, Dec 27, 2009 at 11:13 AM, Hassan S.
[email protected] wrote:

And really, use git for revision control and get in the habit of frequent
commits; it’ll be such a time-saver when you can just

prompt$ git diff config/routes.rb

to find the changes…

And you can then use commands like

git checkout some/file/that/changed

to revert individual files to the state before the generate

or

git reset

To reset the entire working directory to the state of the last commit.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: Rick DeNatale - Developer - IBM | LinkedIn

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

thanks

Regards and Respects,

Kindness in thought leads to wisdom.
Kindness in speech leads to eloquence.
Kindness in action leads to love.

— On Sun, 12/27/09, Marnen Laibow-Koser [email protected] wrote:

From: Marnen Laibow-Koser [email protected]
Subject: [Rails] Re: How can i cancel the effect of a command-generate
cont
To: [email protected]
Date: Sunday, December 27, 2009, 7:57 AM

Oluwayomi O. wrote:

what do i edit in route.rb? thanks

Whatever your version control system says was changed.

If you’re not using version control, download Git and start today.
There is no excuse for working without version control.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Posted via http://www.ruby-forum.com/.

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.