It was so tough things to do Ruby on Rail from scratch but it could be done with only reading the learning material from internet.
Ruby on Rail is very easy to adding the additional filed to the existing web blog by netbean IDE. Netbean IDE can easily create the with windows icon manipulation.
Tip for the Rail console.
This is the command to activated the Rail console without this command line
Rail won't work. I spent lots of time to learn this things...
Rails Console
ActiveRecord.methods.size
ActiveRecord.methods
ActiveRecord::Base.methods.size
ActiveRecord::Base.methods
Message.column_names
Add another field to a table through migration
Right click helloworld project node ans selecte
Generate
Rails Generator>
Generate: migration
Arguments: Topic : string
Migrate Database -> To current Version
Services
helloword_development
Tables
messages
***is here
Modify the controller
value to the name attribute of the @hello
@hello.name = "Sang Shin"
@hello.topic = "Ruby"
Modify the viewer
My topic is <%= @hello.topic %>
# Observe that the Rails Generator dialog box appears.
# Select migration from the Generate drop-down menu.
# For the Arguments field, enter AddNameToMessage name:string. (Figure-2.12
below)
# Click OK. This will create a new migration file.
have to change the class name
AddNameToMessage2 topic:string
Migrate Database->to Current Version
Saturday, February 14, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment