Ability to publish posts, and search and categorize them.Main functionalities which the app will have: It’s going to be a platform where you could search and meet like-minded people. Testing: TDD/BDD (RSpec & Capybara), Factories (Factory Girl).Refactoring: helpers, partials, concerns, design patterns.The following topics will be discussed throughout this guide: The idea is that with every new section you should learn something new. Throughout the whole tutorial, I will gradually introduce new techniques and concepts. This tutorial will go a step further and explain line-by-line how to create a more complex Ruby On Rails application. ((Time.now - birth_date.to_time) / SECONDS_PER_YEAR).There are plenty tutorials online which show how to create your first app. ((Date.today - birth_date) * SECONDS_PER_DAY / SECONDS_PER_YEAR).floor If you want to use only plain ruby, I suggest this answer: SECONDS_PER_YEAR = 31556952 ((Time.now - birth_date.to_time) / 1.year).floor Note the use of floor method to convert the Float in Integerīut you can also use Time, like this : (Time.now - birth_date.to_time).seconds.in_years.floor ((Date.today - birth_date).days / 1.year).floor So, if you work with Date, you can do : (Date.today - birth_date)._years.floor
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |