开发者

starting a rails app and confused [closed]

开发者 https://www.devze.com 2023-04-01 09:49 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so 开发者_StackOverflowthat it can be reopened, visit the help center. Closed 11 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消