RailsApps / learn-rails

An example Rails 5.1 app to accompany the "Learn Ruby on Rails" book.
https://learn-rails.com/install-rails-mac/index.html
392 stars 266 forks source link

attr_accessor method and arguments #102

Closed simoncal-saas closed 7 years ago

simoncal-saas commented 7 years ago

Issues applicable with code and Book Two Version 4.1.0:

1) :string should be removed from 5 attr_accessor Ruby statements. For example, attr_accessor :email, :string should be replaced with attr_accessor :email

2) attr_accessor :name, :string attr_accessor :email, :string attr_accessor :content, :string

can be combined into one statement: attr_accessor :name, :email, :content

3) 2 sentences containing attr_accessor keyword, specifying ........ is a string, should be removed.

We create the email attribute using the attr_accessor keyword, ........ We create attributes (data fields) for the model by using the attr_accessor keyword, ......

DanielKehoe commented 7 years ago

Thanks for suggesting the improvement. I've made the change for the next edition of the book.