{"id":42399,"date":"2023-10-20T15:20:56","date_gmt":"2023-10-20T15:20:56","guid":{"rendered":"http:\/\/startupsmart.test\/2023\/10\/20\/how-to-start-developing-a-web-app-using-ruby-on-rails-startupsmart\/"},"modified":"2023-10-20T15:20:56","modified_gmt":"2023-10-20T15:20:56","slug":"how-to-start-developing-a-web-app-using-ruby-on-rails-startupsmart","status":"publish","type":"post","link":"https:\/\/www.startupsmart.com.au\/uncategorized\/how-to-start-developing-a-web-app-using-ruby-on-rails-startupsmart\/","title":{"rendered":"How to start developing a web app using Ruby on Rails – StartupSmart"},"content":{"rendered":"
\"\"<\/div>\n

Recently, StartupSmart<\/i> looked at developing web apps in PHP<\/a>. However, many developers choose to use an alternative framework called Ruby on Rails.<\/p>\n

 <\/p>\n

So what does Ruby on Rails development entail and how do you get started?<\/p>\n

 <\/p>\n

StartupSmart<\/i> spoke to freelance web developer and Melbourne Ruby group co-organiser Pat Allan to find out.<\/p>\n

 <\/p>\n

Allen explains that at its simplest, Ruby on Rails is made up of a programming language called Ruby and a web app development framework called Rails.<\/p>\n

 <\/p>\n

\u201cRuby is a dynamically typed programming language developed with programmer happiness in mind, and has been around for about 20 years now,\u201d Allan says.<\/p>\n

 <\/p>\n

\u201cRails (or Ruby on Rails) is a framework for constructing web applications. It\u2019s written in Ruby, and you write your own Ruby code to extend the framework to build your own apps (it\u2019s not an app in its own right).\u201d<\/p>\n

 <\/p>\n

A key feature of applications written in Rails, Allen explains, is that they are divided up into three parts, known as \u2018models\u2019, \u2018views\u2019 and \u2018controllers\u2019.<\/p>\n

 <\/p>\n

\u201cFrom Rails\u2019 perspective, the models are your data objects \u2013 e.g. user information, blog posts, purchase details \u2013 whatever data your app needs to use or create. This data is usually persisted in a relational database like PostgreSQL or MySQL,\u201d Allan says.<\/p>\n

 <\/p>\n

\u201cThe views are the presentation layer of your web application \u2013 the HTML that the browser displays, and any manipulation of that HTML to display dynamic content, including data from your models.<\/p>\n

 <\/p>\n

\u201cThe controllers are the glue that connects views and models together \u2013 they load up specific data objects, and choose which views should be sent back to the browser.<\/p>\n

 <\/p>\n

The ability to extend the Rails framework comes by adding libraries of already written code, which are known as \u2018Gems\u2019.<\/p>\n

 <\/p>\n

\u201cGems are collections of Ruby code (libraries) with a focus on specific functionality. There are gems for dealing with Twitter, downloading files, mathematical computations, testing, complex data searching, and much, much more,\u201d Allan says.<\/p>\n

 <\/p>\n

\u201cThe value of this is it saves you from having to re-invent the wheel. Quite often you can end up building on top of others\u2019 hard work instead. Of course, if you can\u2019t find a gem for what you need, you can write one yourself \u2013 everyone is allowed to publish gems.<\/p>\n

 <\/p>\n

\u201cRails itself is a handful of gems, broken out into (mostly) distinct features such as dealing with HTTP requests, interacting with databases, and connecting models, controllers and views.<\/p>\n

 <\/p>\n

For Allan, one of the key strengths of Ruby and Rails is its developer community, which includes events aimed at everyone from beginners to web veterans.<\/p>\n

 <\/p>\n

\u201cThere are a great deal of social events in the Ruby community, especially in Australia, with Rails Camps twice a year, a big conference once a year, occasional RailsGirls sessions, and numerous meet ups in most major cities. These events help us to connect with each other, share our knowledge, learn new things, find new opportunities for work, and make a few new friends,\u201d Allan says.<\/p>\n

 <\/p>\n

\u201cThere are many online tutorials out there and a growing number of online courses as well. Peepcode\u2019s videos<\/a> (now part of PluralSight\u2019s extensive library of content) are top notch and worth every dollar. Ryan Bates\u2019 enduring legacy of RailsCasts is an amazing (and free!) resource, alongside his more detailed paid offering. Michael Hartl\u2019s tutorials are another source of detailed information.<\/p>\n

 <\/p>\n

\u201cHaving mentors available in person can also be super helpful, though, which is why events like RailsGirls and InstallFests are so valuable.<\/p>\n

 <\/p>\n

Allan goes on to explain that the Melbourne Ruby group has its own Meetup group. From there, developers can find out information about its regular presentation evenings, hackfests and InstallFests, which are aimed at new developers.<\/p>\n

 <\/p>\n

Finally, Allan\u2019s advice to anyone thinking about coding a web app in Ruby on Rails is to just get started.<\/p>\n

 <\/p>\n

\u201cThe more code you write, the deeper your understanding becomes, and then you can get a better understanding of other peoples\u2019 code, which in turn helps you to learn new ways of doing things. This is becoming more and more easy given so much of the code we use (including Ruby gems) is open-sourced and available for everyone to peruse,\u201d Allen says.<\/p>\n

 <\/p>\n

\u201cThe best way to become comfortable with Ruby (and programming generally) is to write a lot of code. Of course it\u2019s likely not going to be great code at the beginning, but that\u2019s fine.<\/p>\n

 <\/p>\n

\u201cFinally: Don\u2019t be afraid of what you don\u2019t know. All good developers are in a constant state of learning \u2013 technology is changing all the time \u2013 so there are always opportunities to ask questions and find out how another piece of the evolving puzzle works.\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"

Recently, StartupSmart looked at developing web apps in PHP. However, many developers choose to use an alternative framework called Ruby<\/p>\n","protected":false},"author":2,"featured_media":60353,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/posts\/42399"}],"collection":[{"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/comments?post=42399"}],"version-history":[{"count":0,"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/posts\/42399\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/media\/60353"}],"wp:attachment":[{"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/media?parent=42399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/categories?post=42399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.startupsmart.com.au\/wp-json\/wp\/v2\/tags?post=42399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}