Okay ive read the ruby on rails tutorial book, and i felt like i was learning it. But when i finished i wanna start my own practice project but i cant seem to think of how to start the app.
Are the controller names plural and capitalized? is a model name singular? the book showed that the password hashing and stuff was done in a helper file, but i thought that stuff was done in the model?
i just need some direction on how to start the app skeleton i guess
please help!
what you are probably looking for is:
rails new blog
creates application skeleton.
it is supposed that you have managed already installing ruby and gem rails
By the way you don't really need any book to start with rails
Just try this awesome official tutorial getting started Rails.
Cheers1
To get going you need to have ruby and rubygems installed.
Then you must install rails
sudo gem install rails
Once you have done this Rails will create the app skeleton for you by running this command:
rails new your_app_name
Then you need to read up to understand how to create basic functionality. The best at first is to use the scaffold and learn from the files created by said scaffold.
rails generate scaffold controller_name
Don't worry about plural and singular and stuff. Rails scaffold will take care of that.
I recommend you read extensively the official Rails guides. The information is up to date: http://guides.rubyonrails.org/
Good luck and enjoy the Rails ride.
The main advantage of Ruby on Rails is to build quickly your application. So, for the beginning, use all of the RoR tools. Try this :
rails new my_app_name
rails generate scaffold my_model_name field:type field:type
rake db:migrate
rails server
And you will be able to start with the skeleton you need. For the division between models and helpers juste remember this : the helpers are for help you to print your informations in the views while the model contains the methods for business logic and dialog with database.
精彩评论